Link to home
Start Free TrialLog in
Avatar of nummagumma2
nummagumma2Flag for United States of America

asked on

Cause echo to embed CR/LF?

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?

Avatar of SteveGTR
SteveGTR
Flag of United States of America image

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
Avatar of nummagumma2

ASKER

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.
Oh, sorry... I tested it on 2K and XP - same results...

I'd trust your debug tool... It's gotta be blat.
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.
Learning something new everyday....
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).
You're not alone there... I often over complicate a problem :)
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial