|
-
NT For command and pipe symbol in data file problem
Hi,
I'm working on a script to replace the fifth variable in a text file. The
problems is the | (pipe) delimiter used which the for command parse and removes
it from the file.
set f="delete"
for /F "tokens=1-5 delims=|" %%i in (client.del) do @echo %%i %%j %%k %%l
%f% >> clientowndel.txt
This line will work but not echoing the pipe symbol that I need for the data
import. Can I replicate the pipe symbol without using quotes which would
corrupt the data. Any help would be appreciated.
-
Re: NT For command and pipe symbol in data file problem
You have to isolate the pipe whit an anti-slash "\|"
that's all
-
Re: NT For command and pipe symbol in data file problem
"Michael Liang" <michael.liang@ny.frb.org> wrote:
>
>Hi,
Hi again,
>I'm working on a script to replace the fifth variable in a text file. The
>problems is the | (pipe) delimiter used which the for command parse and
removes
>it from the file.
I cant understand, why you dont use the semikolon - this is the standard
of list-seperators.
Anyway...
>set f="delete"
>for /F "tokens=1-5 delims=|" %%i in (client.del) do @echo %%i %%j %%k %%l
>%f% >> clientowndel.txt
Under W2k and NT4 (SP4) there is no prob with this ! Just I've checked this
on both platforms.
Input-File:
-----------
spalte1|spalte2|spalte3|spalte4|spalte5
client1|client2|client3|client4|
test1|test2|test3|test4
Output-File:
------------
spalte1 spalte2 spalte3 spalte4 "delete"
client1 client2 client3 client4 "delete"
test1 test2 test3 test4 "delete"
>This line will work but not echoing the pipe symbol that I need for the
data
>import. Can I replicate the pipe symbol without using quotes which would
>corrupt the data. Any help would be appreciated.
Please send me your error-message...
ByeBye,
BitH...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks