If I'm not mistaken, Line Input reads up to the first CR/LF, so you won't
find it with the Asc(Right(string))
if statement...
for lack of a better idea, you could open the file as binary, and use the
Get statement to retrieve one byte at a time, then the put statement to
replace any byte positions found to have Chr(13)'s with Chr(9)
Quote:
>I am trying to go through a text file and replace all carriage returns
>with tab (in VBA).
>This is what I am doing:
>open file,
>while not EOF
> read line input as string
> if Asc(Right(string)) = ASCII code for carriage return (its 13)
>then
> make Right(string) = Chr(ASCII code of tab [its 9])
> end if
>loop
>the problem is, that when it reads the line in, it omits the carriage
>return at the end of the line (as expected).
>can anyone help me do this, or know of a better solution.
>Thanks,
>sAwt