Page 1 of 1

help on creating a file

Posted: 04 May 2011 10:42
by feliperivera
Hi All!

I'm executing this command in the cmd command line:
dir c:\mypath\myfolder /b /s > outputfile.txt

This will create a file called outputfile.txt that contains:

c:\mypath\myfolder\\acpkseod.SQL
c:\mypath\myfolder\ACPKSMSC.SQL
c:\mypath\myfolder\CAPKS_FCJ_CADRSMNT_ADDON.SQL
.....
I need to concatenate the "@" before "c:\" in all the lines inside the outputfile.txt, so it will look like this:
@c:\mypath\myfolder\ACPKSMSC.SQL
@c:\mypath\myfolder\CAPKS_FCJ_CADRSMNT_ADDON.SQL
@c:\mypath\myfolder\CAPKS_FCJ_CADSPMNT_ADDON.SQL

how to do this?

Thanks

Re: help on creating a file

Posted: 04 May 2011 16:39
by aGerman
Untested:

Code: Select all

>outputfile.txt type nul
for /f "delims=" %%a in ('dir c:\mypath\myfolder /b /s') do >>outputfile.txt echo %%a

Regards
aGerman

Re: help on creating a file

Posted: 05 May 2011 10:09
by feliperivera
Hi, Thanks for your answer, I finally used an application which I found in http://openetwork.com/berk.html
there I used awk to do it...
Thank you very much anyway!