Hi all,
Please look into the attached txt file. Open in in Notepad. it has some square boxes at end. I want to remove those junk characters completely from that file. i believe these are line endings. How can I remove those characters?
Please help.
Printable View
Hi all,
Please look into the attached txt file. Open in in Notepad. it has some square boxes at end. I want to remove those junk characters completely from that file. i believe these are line endings. How can I remove those characters?
Please help.
I don't seem to have any square boxes showing on mine. My notepad font is Arial, size 10, regular.
Do you have extra line spaces at the end of the file?
I opened that file in some other text editor it showed as a line spaces.
Oh, k then.
Well sorry for it being soo late, but for some reason the last two lines took up 55 characters :sick:.
VB Code:
Dim StrTxt As String Open "D:\test.txt" For Input As #1 StrTxt = Input(LOF(1), 1) Close #1 While Right(StrTxt, 1) = Chr(10) 'chr(10) = Line feed StrTxt = Mid(StrTxt, 1, Len(StrTxt) - 1) Wend Open "C:\test.txt" For Output As #1 Print #1, StrTxt Close #1
OK! Great!
I found a another solution that. But this is very nice.
Thanks!
You could also use Replace(Replace(text, Chr$(10), ""), Chr$(13), "") on each line (not on the entire text).