help on creating a file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
feliperivera
Posts: 2
Joined: 04 May 2011 10:24

help on creating a file

#1 Post by feliperivera » 04 May 2011 10:42

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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: help on creating a file

#2 Post by aGerman » 04 May 2011 16:39

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

feliperivera
Posts: 2
Joined: 04 May 2011 10:24

Re: help on creating a file

#3 Post by feliperivera » 05 May 2011 10:09

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!

Post Reply