Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Scripting > looking for a code to add data

Reply
Thread Tools Display Modes

looking for a code to add data

 
 
Dee
Guest
Posts: n/a

 
      04-22-2009
Hi

I'm looking for a sample code to add some small amount of repeated data
before and after some names in a text file.

Example

the list is

a
b
c
d


I want to add

test a today
test b today
test c today
test d today


any pointers would be great

D
--
Dee
 
Reply With Quote
 
 
 
 
Dee
Guest
Posts: n/a

 
      04-22-2009
thanks, will give it a go
--
Dee


"T Lavedas" wrote:

> On Apr 22, 7:06 am, Dee <D...@discussions.microsoft.com> wrote:
> > Hi
> >
> > I'm looking for a sample code to add some small amount of repeated data
> > before and after some names in a text file.
> >
> > Example
> >
> > the list is
> >
> > a
> > b
> > c
> > d
> >
> > I want to add
> >
> > test a today
> > test b today
> > test c today
> > test d today
> >
> > any pointers would be great
> >
> > D
> > --
> > Dee

>
> Try something like ...
>
> @echo off
> if '%1'=='' (echo Input file name missing. & goto :eof)
> (for /f "delims=" %%a in (%~1) do echo test %%a today) >
> "%~1.out.txt"
>
> This will process the input file into an output file having two
> additional extensions added to its name, ".out.txt". The input file
> name is provided on the command line as an input.
>
> Type FOR /? at a command prompt for more information on the syntax.
>
> Tom Lavedas
> ***********
> http://there.is.no.more/tglbatch/
>

 
Reply With Quote
 
Dee
Guest
Posts: n/a

 
      04-22-2009
It worked a treat, thanks again
--
Dee


"Dee" wrote:

> thanks, will give it a go
> --
> Dee
>
>
> "T Lavedas" wrote:
>
> > On Apr 22, 7:06 am, Dee <D...@discussions.microsoft.com> wrote:
> > > Hi
> > >
> > > I'm looking for a sample code to add some small amount of repeated data
> > > before and after some names in a text file.
> > >
> > > Example
> > >
> > > the list is
> > >
> > > a
> > > b
> > > c
> > > d
> > >
> > > I want to add
> > >
> > > test a today
> > > test b today
> > > test c today
> > > test d today
> > >
> > > any pointers would be great
> > >
> > > D
> > > --
> > > Dee

> >
> > Try something like ...
> >
> > @echo off
> > if '%1'=='' (echo Input file name missing. & goto :eof)
> > (for /f "delims=" %%a in (%~1) do echo test %%a today) >
> > "%~1.out.txt"
> >
> > This will process the input file into an output file having two
> > additional extensions added to its name, ".out.txt". The input file
> > name is provided on the command line as an input.
> >
> > Type FOR /? at a command prompt for more information on the syntax.
> >
> > Tom Lavedas
> > ***********
> > http://there.is.no.more/tglbatch/
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

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
Code in Data Section L. Spiro Windows Vista Drivers 4 02-14-2008 09:21 AM
data code does not transfer to dvd Jas101 Windows Vista Music, Pictures and Video 2 01-19-2008 06:54 AM
appdata-local-Application Data-Application Data-Application Data infinitum ad nauseum. WHY keepout@yahoo.com.invalid Windows Vista General Discussion 16 09-16-2007 12:50 AM
C:\Data\Profiles\acarol\Application Data\Sun\Java\Deployment\cache Imtiaz Kiani Windows Small Business Server 0 06-03-2005 02:54 PM
cannot download guide data for zip code Marty L Windows Media Center 6 03-26-2005 04:01 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59