PC Review Forums Newsgroups Windows 2000 Microsoft Windows 2000 CMD Promt delims?

Reply

delims?

 
Thread Tools Rate Thread
Old 02-09-2003, 01:53 PM   #1
Y
Guest
 
Posts: n/a
Default delims?


Hi,

How to specify carriage return as delims? Thanks..

for /f "tokens=1-3 delims=?" %%a in (


  Reply With Quote
Old 02-09-2003, 02:01 PM   #2
Ray at
Guest
 
Posts: n/a
Default Re: delims?

for /f "tokens=1-3 delims=^T" %%a in (

(ctrl+T) or ¶

Ray at work

"Y" <yilue7490@rogers.com> wrote in message
news:%23L3XUmVcDHA.3872@TK2MSFTNGP11.phx.gbl...
> Hi,
>
> How to specify carriage return as delims? Thanks..
>
> for /f "tokens=1-3 delims=?" %%a in (
>
>



  Reply With Quote
Old 02-09-2003, 02:36 PM   #3
Ray at
Guest
 
Posts: n/a
Default Re: delims?

Sorry, this is in a .bat/.cmd file, so the ^T will not work. Use ¶.
(Alt+0182)

Ray at work

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
news:%23%23E%23BrVcDHA.1540@tk2msftngp13.phx.gbl...
> for /f "tokens=1-3 delims=^T" %%a in (
>
> (ctrl+T) or ¶
>
> Ray at work
>
> "Y" <yilue7490@rogers.com> wrote in message
> news:%23L3XUmVcDHA.3872@TK2MSFTNGP11.phx.gbl...
> > Hi,
> >
> > How to specify carriage return as delims? Thanks..
> >
> > for /f "tokens=1-3 delims=?" %%a in (
> >
> >

>
>



  Reply With Quote
Old 02-09-2003, 08:28 PM   #4
Ritchie
Guest
 
Posts: n/a
Default Re: delims?

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message news:uZ3TP#VcDHA.356@TK2MSFTNGP11.phx.gbl...
> Sorry, this is in a .bat/.cmd file, so the ^T will not work. Use ¶.
> (Alt+0182)


Can you confirm that you've successfully managed to use a carriage
return as a delimiter in a FOR /F loop?

--
Ritchie, Undo address for email


  Reply With Quote
Old 02-09-2003, 08:41 PM   #5
Ray at
Guest
 
Posts: n/a
Default Re: delims?

I have. Try pasting this into a .bat file and running it from the command
prompt.

echo a>test.txt
echo b>>test.txt
echo c>>test.txt

for /f "tokens=1-3 delims=¶" %%a in (test.txt) do (net send %computername%
%%a)

Ray at work

"Ritchie" <rlawrence@commanddoline.co.uk> wrote in message
news:3f54fd5b$0$247$cc9e4d1f@news.dial.pipex.com...
> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message

news:uZ3TP#VcDHA.356@TK2MSFTNGP11.phx.gbl...
> > Sorry, this is in a .bat/.cmd file, so the ^T will not work. Use ¶.
> > (Alt+0182)

>
> Can you confirm that you've successfully managed to use a carriage
> return as a delimiter in a FOR /F loop?
>
> --
> Ritchie, Undo address for email
>
>



  Reply With Quote
Old 03-09-2003, 06:01 AM   #6
Ritchie
Guest
 
Posts: n/a
Default Re: delims?

"Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message news:OVoRKKZcDHA.2416@TK2MSFTNGP10.phx.gbl...
> I have. Try pasting this into a .bat file and running it from the command
> prompt.
>
> echo a>test.txt
> echo b>>test.txt
> echo c>>test.txt
>
> for /f "tokens=1-3 delims=¶" %%a in (test.txt) do (net send %computername%
> %%a)


Try this:-

for /f %%a in (test.txt) do net send %computername% %%a

Notice anything?

--
Ritchie, Undo address for email


  Reply With Quote
Old 03-09-2003, 12:52 PM   #7
Ray at
Guest
 
Posts: n/a
Default Re: delims?

Ah, yes, I do notice something. :] So, hmm. Um.

Ray at work

"Ritchie" <rlawrence@commanddoline.co.uk> wrote in message
news:3f5583b8$0$253$cc9e4d1f@news.dial.pipex.com...
> "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message

news:OVoRKKZcDHA.2416@TK2MSFTNGP10.phx.gbl...
> > I have. Try pasting this into a .bat file and running it from the

command
> > prompt.
> >
> > echo a>test.txt
> > echo b>>test.txt
> > echo c>>test.txt
> >
> > for /f "tokens=1-3 delims=¶" %%a in (test.txt) do (net send

%computername%
> > %%a)

>
> Try this:-
>
> for /f %%a in (test.txt) do net send %computername% %%a
>
> Notice anything?
>
> --
> Ritchie, Undo address for email
>
>



  Reply With Quote
Old 03-09-2003, 01:53 PM   #8
Tom Lavedas
Guest
 
Posts: n/a
Default Re: delims?

As far as I can tell, this is a dead end. First of all a
Control-T is created with Alt-20, but that won't work
anyway. I believe the object is to create a line with
anewline character in the displayed message. Isn't it?

The problem being that NET SEND interprets the CR/LF pair
as the end of the statement and therefore truncates the
message string after the first newline intended for output.

The solution I found is to use a linefeed without a
carriage return. However, it's hard to create this in a
batch procedure or most editors. Notepad and Edit
both 'correct' the malformed lines. In fact, even when I
used DEBUG to change the line ends to linefeeds only, it
appears that the command processor corrected the line ends
as it executed the batch file.

About the best I found was to use a WSH script, something
like this ...

with createobject("wscript.shell")
..run "net send %computername% a" & chr(10) _
& "b" & chr(10) & "c", 0, false
end with

Of course the literals "a", "b" and "c" can be replaced
with variables containing the desired text, possibly read
in from a text file, or as command line parameters (if
they're not too long).

Tom Lavedas
===========

>-----Original Message-----
>"Ray at <%=sLocation%>" <myfirstname at lane34 dot com>

wrote in message
news:OVoRKKZcDHA.2416@TK2MSFTNGP10.phx.gbl...
>> I have. Try pasting this into a .bat file and running

it from the command
>> prompt.
>>
>> echo a>test.txt
>> echo b>>test.txt
>> echo c>>test.txt
>>
>> for /f "tokens=1-3 delims=¶" %%a in (test.txt) do (net

send %computername%
>> %%a)

>
>Try this:-
>
> for /f %%a in (test.txt) do net send %computername% %%a
>
>Notice anything?
>
>--
>Ritchie, Undo address for email
>
>
>.
>

  Reply With Quote
Old 03-09-2003, 05:32 PM   #9
Ray at
Guest
 
Posts: n/a
Default Re: delims?


"Tom Lavedas" <tlavedas@hotmail.com> wrote in message
news:059e01c37222$b6f240d0$a001280a@phx.gbl...
As far as I can tell, this is a dead end. First of all a
Control-T is created with Alt-20, but that won't work
anyway. I believe the object is to create a line with
anewline character in the displayed message. Isn't it?

The OP was trying to use the line feed as a delimiter. The Ctrl+T would
work in edit.com, but if you do it in notepad or something, you can use ¶.



The problem being that NET SEND interprets the CR/LF pair
as the end of the statement and therefore truncates the
message string after the first newline intended for output.


I just used net send for the sake of using something. I could have echoed
instead. Either way, my example was wrong. :]






The solution I found is to use a linefeed without a
carriage return. However, it's hard to create this in a
batch procedure or most editors. Notepad and Edit
both 'correct' the malformed lines. In fact, even when I
used DEBUG to change the line ends to linefeeds only, it
appears that the command processor corrected the line ends
as it executed the batch file.

About the best I found was to use a WSH script, something
like this ...

with createobject("wscript.shell")
..run "net send %computername% a" & chr(10) _
& "b" & chr(10) & "c", 0, false
end with



Using just .bat, you can do
net send %computername% a¶b¶c







  Reply With Quote
Old 03-09-2003, 06:41 PM   #10
Tom Lavedas
Guest
 
Posts: n/a
Default Re: delims?

Yes, I figured out I was barking up the wrong tree.

I posted a retraction of sorts and what I believe is a
workaround for the original request.

Tom Lavedas
===========

>-----Original Message-----
>
>"Tom Lavedas" <tlavedas@hotmail.com> wrote in message
>news:059e01c37222$b6f240d0$a001280a@phx.gbl...
>As far as I can tell, this is a dead end. First of all a
>Control-T is created with Alt-20, but that won't work
>anyway. I believe the object is to create a line with
>anewline character in the displayed message. Isn't it?
>
>The OP was trying to use the line feed as a delimiter.

The Ctrl+T would
>work in edit.com, but if you do it in notepad or

something, you can use ¶.

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off