?
Solved

echo tab character

Posted on 2007-11-28
3
Medium Priority
?
9,514 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 75 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 75 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

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…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month12 days, 21 hours left to enroll

777 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