PC Review


Reply
Thread Tools Rate Thread

How to append characters in a line

 
 
Wensi Peng
Guest
Posts: n/a
 
      15th Jan 2005
Hello,

I have leaned here how to add characters in front of a line by SET /P.
Today I would like to ask how to append characters in a line?

Example:

original output:

IP: 10.1..1.1
IP: 10.1.1.2
...........
IP: 10.1.1.n

Now I want to append vendor name, for instance

IP: 10.1..1.1 IBM server
IP: 10.1.1.2 HP server
...........
IP: 10.1.1.n DELL server

Thanks,
Wensi


 
Reply With Quote
 
 
 
 
Jerold Schulman
Guest
Posts: n/a
 
      17th Jan 2005
On Sat, 15 Jan 2005 12:39:50 -0500, "Wensi Peng" <(E-Mail Removed)> wrote:

>Hello,
>
>I have leaned here how to add characters in front of a line by SET /P.
>Today I would like to ask how to append characters in a line?
>
>Example:
>
>original output:
>
>IP: 10.1..1.1
>IP: 10.1.1.2
>..........
>IP: 10.1.1.n
>
>Now I want to append vendor name, for instance
>
>IP: 10.1..1.1 IBM server
>IP: 10.1.1.2 HP server
>..........
>IP: 10.1.1.n DELL server
>
>Thanks,
>Wensi
>

for /f "Tokens=1,2" %%a in ('type filename') do (
"%commonProgramFiles%\Microsoft Shared\msinfo\MSINFO32.EXE" /computer %%b /categories systemsummary /report "%TEMP%\MSINFO.TMP"
:: parse the "%TEMP%\MSINFO.TMP" and extract the Manufacturer and OS type.
)



Jerold Schulman
Windows Server MVP
JSI, Inc.
http://www.jsiinc.com
 
Reply With Quote
 
Wensi Peng
Guest
Posts: n/a
 
      19th Jan 2005
I was asking a general question fro appending characters. It is independent
on any specifical commands.

Thanks,
Wensi
"Jerold Schulman" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> On Sat, 15 Jan 2005 12:39:50 -0500, "Wensi Peng" <(E-Mail Removed)>

wrote:
>
> >Hello,
> >
> >I have leaned here how to add characters in front of a line by SET /P.
> >Today I would like to ask how to append characters in a line?
> >
> >Example:
> >
> >original output:
> >
> >IP: 10.1..1.1
> >IP: 10.1.1.2
> >..........
> >IP: 10.1.1.n
> >
> >Now I want to append vendor name, for instance
> >
> >IP: 10.1..1.1 IBM server
> >IP: 10.1.1.2 HP server
> >..........
> >IP: 10.1.1.n DELL server
> >
> >Thanks,
> >Wensi
> >

> for /f "Tokens=1,2" %%a in ('type filename') do (
> "%commonProgramFiles%\Microsoft Shared\msinfo\MSINFO32.EXE" /computer %%b

/categories systemsummary /report "%TEMP%\MSINFO.TMP"
> :: parse the "%TEMP%\MSINFO.TMP" and extract the Manufacturer and OS

type.
> )
>
>
>
> Jerold Schulman
> Windows Server MVP
> JSI, Inc.
> http://www.jsiinc.com



 
Reply With Quote
 
Dean Wells [MVP]
Guest
Posts: n/a
 
      19th Jan 2005
I'm not sure I understand what you're asking since you already know how
to use 'set /p' ... post your current script in order to assist.

--
Dean Wells [MVP / Directory Services]
MSEtechnology
[[ Please respond to the Newsgroup only regarding posts ]]
R e m o v e t h e m a s k t o s e n d e m a i l

Wensi Peng wrote:
> Hello,
>
> I have leaned here how to add characters in front of a line by SET /P.
> Today I would like to ask how to append characters in a line?
>
> Example:
>
> original output:
>
> IP: 10.1..1.1
> IP: 10.1.1.2
> ..........
> IP: 10.1.1.n
>
> Now I want to append vendor name, for instance
>
> IP: 10.1..1.1 IBM server
> IP: 10.1.1.2 HP server
> ..........
> IP: 10.1.1.n DELL server
>
> Thanks,
> Wensi



 
Reply With Quote
 
Phil Robyn (MVP)
Guest
Posts: n/a
 
      19th Jan 2005
Wensi Peng wrote:

> I was asking a general question fro appending characters. It is independent
> on any specifical commands.
>
> Thanks,
> Wensi


- - - - - - - - - - begin screen capture WinXP - - - - - - - - - -
C:\cmd>demo\AppendingText
my_variable is [This is some text ]
my_variable is [This is some text and this is appended.]

C:\cmd>rlist demo\AppendingText.cmd
=====begin C:\cmd\demo\AppendingText.cmd ====================
1. @echo off
2. setlocal
3. set "my_variable=This is some text "
4. echo my_variable is [%my_variable%]
5. set my_variable=%my_variable% and this is appended.
6. echo my_variable is [%my_variable%]
=====end C:\cmd\demo\AppendingText.cmd ====================
- - - - - - - - - - end screen capture WinXP - - - - - - - - - -


> "Jerold Schulman" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>
>>On Sat, 15 Jan 2005 12:39:50 -0500, "Wensi Peng" <(E-Mail Removed)>

>
> wrote:
>
>>>Hello,
>>>
>>>I have leaned here how to add characters in front of a line by SET /P.
>>>Today I would like to ask how to append characters in a line?
>>>
>>>Example:
>>>
>>>original output:
>>>
>>>IP: 10.1..1.1
>>>IP: 10.1.1.2
>>>..........
>>>IP: 10.1.1.n
>>>
>>>Now I want to append vendor name, for instance
>>>
>>>IP: 10.1..1.1 IBM server
>>>IP: 10.1.1.2 HP server
>>>..........
>>>IP: 10.1.1.n DELL server
>>>
>>>Thanks,
>>>Wensi
>>>

>>
>>for /f "Tokens=1,2" %%a in ('type filename') do (
>> "%commonProgramFiles%\Microsoft Shared\msinfo\MSINFO32.EXE" /computer %%b

>
> /categories systemsummary /report "%TEMP%\MSINFO.TMP"
>
>>:: parse the "%TEMP%\MSINFO.TMP" and extract the Manufacturer and OS

>
> type.
>
>>)
>>
>>
>>
>>Jerold Schulman
>>Windows Server MVP
>>JSI, Inc.
>>http://www.jsiinc.com

>
>
>



--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l
 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cursor floating on line & characters not typing across line grandyhomeschooler Microsoft Word Document Management 1 8th Jan 2009 06:48 AM
Append Query error? Characters found after end of SQL statement? Nathon Jones Microsoft Access 5 6th Feb 2006 11:59 AM
Using REN to append characters to a batch of filenames? BillW50 Microsoft Windows 2000 2 22nd Oct 2005 03:03 AM
Append query - memo truncated to 765 characters Martin Jeffreys Microsoft Access Queries 3 6th Jul 2004 02:57 PM
how does excel store new line and line feed characters? ben h Microsoft Excel Programming 0 1st Jul 2004 02:34 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:51 PM.