[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

delimiting characters in DOS echo command trying to use "|" in echo

Posted on 2004-11-15
3
Medium Priority
?
1,335 Views
Last Modified: 2013-11-18
I am trying to generate a .bat file from my asp page - here is the last piece that is not working - i think the | character is failing it on line 14. Thanks in advance. my goal is to have  abt file do a few functions - then create a text file.

echo [test file] > test.txt
echo 0 >> test.txt
echo 2 >> test.txt
echo 0 >> test.txt
echo 0 >> test.txt
echo 0 >> test.txt
echo 1 >> test.txt
echo 0 >> test.txt
echo 0 >> test.txt
echo 0 >> test.txt
echo 0 >> test.txt
echo 100 >> test.txt
echo 10341 >>test.txt
echo Microsoft Word 2003|1090 >> test.txt
echo Insert and edit text, symbols and special characters|Module1090_302 (PB) >> test.txt
echo 1 >> test.txt
echo ~ >> test.txt
echo 6~You find all of the formatting marks distracting. Hide them.~302~~~~~~~~~~12927~WW03S-1-1 >> test.txt
0
Comment
Question by:nphoenix
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
samchan earned 1000 total points
ID: 12589912
The | character is called "pipe" in DOS which is used to redirects the output of a program or command to a second program or command.

For example:
To sort a directory listing based on the time the files were last modified, the output of a directory listing is piped to the SORT filter which sorts on the 39th character of each line:
DIR c:\dirlist | SORT /+39

The possible solutions for your problem could be:
1. Use a different character instead of |
2. Echo "Microsoft Word 2003|1090" >> test.txt
0
 

Author Comment

by:nphoenix
ID: 12589962
Impossible - need to have the "|" just found that ^ preceding it makes it work - thanks
0
 

Author Comment

by:nphoenix
ID: 12589991
and the " " would appear in the output
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

834 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