Solved

An additional character getting inserted when use chr(10)

Posted on 2008-06-20
3
2,389 Views
Last Modified: 2010-04-30
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.
0
Comment
Question by:TG_Sekhar
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
moorhouselondon earned 100 total points
ID: 21836890
chr(10) is the LineFeed character.
                                                     On its' own, this is the effect it has.  Is this what you want?


Most apps do a chr(13) + chr(10)
which is carriage return + line feed, so that the text not only goes onto the next line, but returns to the left hand side as well, as in this example
0
 

Author Comment

by:TG_Sekhar
ID: 22209818
Sorry for a delayed feedback.
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.
0
 
LVL 31

Expert Comment

by:moorhouselondon
ID: 22210454
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.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about achieving the basic levels of HRIS security in the workplace.
Messaging apps are amazing tools with the power to do a lot of good, but the truth is the process of collaborating with coworkers requires relationships established through meaningful communication - the kind of communication that only happens face-…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question