May 7th, 2006, 12:03 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Remove junk characters
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.
Attached Files
May 7th, 2006, 12:05 AM
#2
Re: Remove junk characters
I don't seem to have any square boxes showing on mine. My notepad font is Arial, size 10, regular.
May 7th, 2006, 12:08 AM
#3
Thread Starter
Frenzied Member
Re: Remove junk characters
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.
May 7th, 2006, 12:55 AM
#4
Re: Remove junk characters
Oh, k then.
Well sorry for it being soo late, but for some reason the last two lines took up 55 characters .
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
May 7th, 2006, 06:54 AM
#5
Thread Starter
Frenzied Member
Re: Remove junk characters
OK! Great!
I found a another solution that. But this is very nice.
Thanks!
May 7th, 2006, 06:37 PM
#6
Re: [RESOLVED] Remove junk characters
You could also use Replace(Replace(text, Chr$(10), ""), Chr$(13), "") on each line (not on the entire text).
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width