How can you change the line delimiter that vba uses for the “read line” command? I am trying to read data files generated in a Unix environment, which only uses LF, not the CRLF that VBA is looking for.
FPath="UnixDataFile"
Open FPath For Input As #1
Do While Not EOF(1)
Line Input #1, Single_Line
Loop
Close #1
Unix uses only a LF (Chr 10), which is not recognized by VBA as a line brake. When this code runs, it only takes 1 pass to read the entire file. The working solution I have now is to pass the line through a "Split" function (Too bad one does already not exist in Excel 97 VBA). Other solutions would be to pass the data files through a "Unix2Dos" command on the Unix boxes, but this is undesirable due to the large number of files I am working with. Plus, I would just like to know if it is possible to change the line delimiter. (Or maybe I got spoiled with AWK).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.