Chr Hex0C is the printer linefeed character and Hex0D is the carriage return needed to print a new line. Its always there wherever you have typed the enter key.
The INSTR function searches for any characters in a string and returns it's position in the file, then you could use Left() and Mid() to get the string up to the chrs and the part after it and recombine them. If more than one set of OC CD's then loop until none found
Dim StartPos as Integer,ChrPosn as Integer
StartPos=1
ChrPosn=1
Do while ChrPosn > 0 'keep looking until none found
ChrPosn = INSTR(StartPos,MyString,(Chr(&h0C) & Chr(&h0D)))
MyString=Left(MyString,ChrPosn-1) & Mid(MyString,ChrPosn+2)
StartPos=ChrPosn + 2 'look ahead for more
Loop
it is ge3nerally better to replace whitespace characters (e.g. CR; LF; FF) with a space than "Nothing". Replacing them with nothing leave hte previous and next characters jammed together, making reading hte file (by people anyway) much more taxing. Leaving the space in place of the whitespace leaves it more (humanly) readable
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.