Solved

echo tab character

Posted on 2007-11-28
3
9,249 Views
Last Modified: 2010-08-05
hi,

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

echo Field1 tab Field2 >> logfile.txt

thanks
0
Comment
Question by:xenium
[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
3 Comments
 
LVL 40

Accepted Solution

by:
evilrix earned 25 total points
ID: 20368524
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
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 25 total points
ID: 20368526
You can always do it from Notepad, i.e.

set tab=(hit the tab key)
echo field1%tab%field2%tab%field3  > logfile.txt
0
 

Author Comment

by:xenium
ID: 20369261
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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Using dates in 'DOS' batch files has always been tricky as it has no built in ways of extracting date information.  There are many tricks using string manipulation to pull out parts of the %date% variable or output of the date /t command but these r…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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