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
Solved

echo tab character

Posted on 2007-11-28
3
9,189 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
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

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…
YESTERDAY YESTERDAY.BAT is inspired by a previous article I wrote entitled: TOMORROW.BAT (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/MS_DOS/A_4196-Advanced-Batch-File-Programming-TOMORROW-BAT.html). The crux of this batch f…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

856 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