Solved

An additional character getting inserted when use chr(10)

Posted on 2008-06-20
3
2,385 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
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Introduction This article provides a high-level overview of the Quick Campaign and Campaign features of Microsoft CRM. The purpose of both types of campaign is to track outgoing marketing activity and customer responses in a single record. F…
If you have problems displaying reports in CRM after a new installation, review the following steps: Check that SQL Server Reporting Services is working On the server that has SQL Server Reporting Services (SQL SRS) installed, check that the S…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

803 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