File: trcomma2dot.vbs

package info (click to toggle)
r-cran-sqldf 0.4-11-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 316 kB
  • sloc: awk: 91; sh: 13; makefile: 5
file content (21 lines) | stat: -rw-r--r-- 546 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
'' convert commas to dots
'' based on code by Ekkehard Horner

Option Explicit

WScript.Quit miniTr()

Function miniTr()
   Dim sSearch  : sSearch  = ","
   Dim sReplace : sReplace = "."
   Do Until WScript.StdIn.AtEndOfStream
      Dim sInpChr : sInpChr = WScript.StdIn.Read( 1 )
      Dim sOutChr : sOutChr = sInpChr
      Dim nPos    : nPos    = InStr( sSearch, sInpChr )
      If 0 < nPos Then
         sOutChr = Mid( sReplace, nPos, 1 )
      End If
      WScript.StdOut.Write sOutChr
   Loop
   miniTr = 0
End Function