Solved

Cause echo to embed CR/LF?

Posted on 2004-08-31
10
1,164 Views
Last Modified: 2013-11-18
When I do:

>>file.txt echo Text

It appears as though the text does not include a CR/LF...? (But, to be honest, my text editor is weak for this)

I don't want to have to use
 echo Text >>file.txt

for this application... How can I ensure that a CR/LF is embedded?

0
Comment
Question by:nummagumma2
10 Comments
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
I did both on my XP Pro machine at home and both acted exactly the same. When I ran debug against the resulting text file, both had this:

0B5B:0100  54 65 73 74 0D 0A

I appended more information I got:

0B5B:0100  54 65 73 74 0D 0A 54 65-73 74 20 0D 0A

What operating system are you using?

Could it be that the prior process is not putting the CR/LF? In that case the following should do the trick:

>>file.txt echo.

or

echo.>>file.txt

Good Luck,
Steve
0
 
LVL 1

Author Comment

by:nummagumma2
Comment Utility
The only processes in question are various >> to create a logile...

I currently have it using echo.>>file.txt, but this isn't a very visually appealing solution when looked at in email...

I'm using blat.exe to email this file... and I'm thinking that the fault may lie with blat. :/



Thanks for your efforts... I'll post here if I learn more.
0
 
LVL 1

Author Comment

by:nummagumma2
Comment Utility
Oh, sorry... I tested it on 2K and XP - same results...

I'd trust your debug tool... It's gotta be blat.
0
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
I'm just DOS's debug. To use do the following:

debug test.txt
d
q

The 'd' command dumps out the file in hex. The 'q' command quits DOS.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 1

Author Comment

by:nummagumma2
Comment Utility
Learning something new everyday....
0
 
LVL 16

Expert Comment

by:glenn_1984
Comment Utility
0
 
LVL 1

Author Comment

by:nummagumma2
Comment Utility
Duh.

The text file does of course have CRLF in them.

blat.exe is also sending them properly to the email address.

The email program (Outlook 2002) was stripping off extra LF by default.

Stupid Outlook.  (Stupid Numma).
0
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
You're not alone there... I often over complicate a problem :)
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
Comment Utility
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now