Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi I tried wirting a VB Script like this..
<Code>
Const ForReading = 1
Const ForWriting = 2strFileName = "HRD.csv"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFileName, ForReading)strText = objFile.ReadAll
objFile.ClosestrNewText = Replace(strText, vbCr, "$$$$")
'strNewText = Replace(strNewText, "$$$$", vbCrLf)Set objFile = objFSO.OpenTextFile(strFileName, ForWriting)
objFile.WriteLine strNewText
objFile.Close
<Code/>
This is removing the CRs but also LF. Converting all the records into one single record. I know im close to resolving this issue..but im missing something..I believe it can be resolved if i can write a VBscript with thee following logic.
1. Open the File.
2. Read the file line by line.
3. For each line identify each character.
4. Check if that character is Double Quotes(")
5. If its Double Quotes then
6. Check for each charcter if its a CR or LF
7. If its Double Quote then exit this loop.
8. Repeat the Step 5 to 7 until you reach the EOF.
9. Save the Modified File
10. Close the File
Is this logic implemetable?

![]() |
Compile A List of Text, H...
|
Need help in creating mul...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |