I have the following script. It converts any CRLFs in the flat file to LFs. I only want this to happen when the CRLFs are are not the row delimiter. This flat file has a | delimiter for columns, and " for text. ALL fields are text.
Dim file As New System.IO.StreamReader("\\MyServer\D$\MyFolder\MyFile.txt")
Dim data As String
data = file.ReadToEnd()
data = data.Replace(vbCrLf, vbLf) -- I ONLY WANT TO DO THIS IF IT'S NOT THE ROW DELIMITER
file.Close()
Dim writer As New System.IO.StreamWriter(("\\MyServer\D$\MyFolder\MyFile.txt"), False)
writer.Write(data)
writer.Flush()
writer.Close()
Can someone please help me with the syntax to ignore the replace when it's the row delimiter?f
[font="Courier New"]ZenDada[/font]