Input with Unix files
I am trying to write a script to read lines from a file that was created by a unix-based system. There are too many lines in the file to just open it as fixed-width text. (I'm reading each line, checking for certain values, and maybe writing it to the worksheet) I've worked with files that use <cr>(ascii 13) at the end of lines, and files that use <cr><lf>(ascii 13/10) at the end of lines, no problem, but this one just uses the <lf>(ascii 10).
Using
Input #1 LineString
attempts to read the whole file into a string variable, instead of just a single line of text.
If I open the file into Wordpad and re-save it as text, Input #1 works fine. I'd like to avoid this step if possible, because some of these files are large, and I'd like to avoid reading, writing, and re-reading them.
Is there any way to treat the <lf> alone as an end-of-line character?
It's kind of strange that it isn't automatically read that way.
Oh, using Excel 2003 (11.8146.8132) SP2, in case that matters.
|