PC Review
Forums
Newsgroups
Windows 2000
Microsoft Windows 2000 CMD Promt
delims?
Forums
Newsgroups
Windows 2000
Microsoft Windows 2000 CMD Promt
delims?
![]() |
delims? |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi,
How to specify carriage return as delims? Thanks.. for /f "tokens=1-3 delims=?" %%a in ( |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 ( > > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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 ( > > > > > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
"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 |
|
|
|
#5 |
|
Guest
Posts: n/a
|
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 > > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
"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 |
|
|
|
#7 |
|
Guest
Posts: n/a
|
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 > > |
|
|
|
#8 |
|
Guest
Posts: n/a
|
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 > > >. > |
|
|
|
#9 |
|
Guest
Posts: n/a
|
"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 |
|
|
|
#10 |
|
Guest
Posts: n/a
|
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 ¶. |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

