|
server
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
looking for a code to add dataI'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 On Apr 22, 7:06 am, Dee <D***@discussions.microsoft.com> wrote:
Show quoteHide quote > Hi Try something like ...> > 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 @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/ thanks, will give it a go
-- Show quoteHide quoteDee "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/ > It worked a treat, thanks again
-- Show quoteHide quoteDee "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/ > > On Apr 22, 10:07 am, Dee <D***@discussions.microsoft.com> wrote:
Show quoteHide quote > It worked a treat, thanks again You're welcome. Thanks for the feedback.> -- > 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/ Tom Lavedas *********** http://there.is.no.more/tglbatch/
Logon script help
Batch Script Text file parse Drive Mapping in Server 2008 Query OU for disabled computers Issues when launching a vbscript file from hta interface file Re: Updating AD with a script convert vb script to exe Command to add registry entry Total size of sql databases Scripting, Local Admin Account |
|||||||||||||||||||||||