echo tab character

hi,

How can i echo a tab character? I want this for creating a tab-delimited logfile

echo Field1 tab Field2 >> logfile.txt

thanks
xeniumAsked:
Who is Participating?
 
evilrixConnect With a Mentor Senior Software Engineer (Avast)Commented:
I do not believe it is possible to convince DOS echo to echo control characters using escape strings (such as \t); however, there is no reason why you can't just embed a normal tab in your output if this is part of a batch file.

E.g.


echo hello	world

Open in new window

0
 
Steve KnightConnect With a Mentor IT ConsultancyCommented:
You can always do it from Notepad, i.e.

set tab=(hit the tab key)
echo field1%tab%field2%tab%field3  > logfile.txt
0
 
xeniumAuthor Commented:
thanks, i didn't think of this, which is easy since the batch command is being generated by a program that easily assigns the tab character.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.