I am not a c++ programmer, normally i write in vb. But I have a need to imbed some c++ code in a SISS package.
I does a simple process, It finds an @ in each file record and removes the @ and any spaces before the @, writes the record to a temp file with a CR+LF.
My VB code is:
dim strline, posi, txt
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(WScript.Arguments(0), ForReading)
Set objFile = objFSO.CreateTextFile("temp.out",True)
infile = WScript.Arguments(0)
Do Until objTextFile.AtEndOfStream
strLine = objTextFile.ReadLine
x=instr(strLine,"@")
txt = (Left(strline,x)) + vbcrlf
objFile.Write txt
loop