Sekhar T G
asked on
An additional character getting inserted when use chr(10)
Whenever I use chr(10) an additional character is getting inserted (May be chr(13)). How to get rid of this.
Please do not suggest to open the file using another programming language and use a replace command. This is tried and working. But neither elegant and also can take time when my file size is large.
Please do not suggest to open the file using another programming language and use a replace command. This is tried and working. But neither elegant and also can take time when my file size is large.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is the ASCII code for the non-printable character? Either open the file you are saving using debug (at the command prompt), or use a hex editor. Both of these will give you the Hexadecimal code for the spurious code.
debug file.txt
Useful debug commands (press Enter to invoke command)
D
Displays the next block of data from the file
Q
Quits back to the command prompt.
debug file.txt
Useful debug commands (press Enter to invoke command)
D
Displays the next block of data from the file
Q
Quits back to the command prompt.
ASKER
I am getting by inserting chr(10) the effect of both line feed + carriage return. Apart from that I am getting a non-printable character in addition.
The current work around being used to get rid of this is to open the file in textpad and save in PCDos format.
Any other elegant solution is welcome.