Opening Text file in Binary mode for reading
hello friends,
I am opeining a text file in Binary mode for input which has data given below and then writing it to CSV file
Data in Text file
ID Name strQtrTxbl strYtdTxbl
485741167 Abens, Stuart F. 6,565.24 6,565.24
Syntax used
Open File For Binary As #1
And then after reading the data,I am writing the data to output CSV file
strQtrTxbl = Trim(Mid(strData, 43, 15))
strYtdTxbl = Trim(Mid(strData, 58, 15))
But as you can see the data in strQtrTxbl = 6,565.24 so when i am trying to write it to CSV file, it is getting wrritten in two different fields as program is considering "," as delimiter
My confusion is when i have opened the file in Binary mode then "," should not be considered as delimiter, it should be considered as string
Question - Please help me where i am wrong ?
Note : i can remove the "," from the data and then write also <- this i know
Thanks and Regards
Lawson, COBOL
__________________
Thanks and Regards
Lawson, COBOL
|