Page 1 of 1

editing a text file

Posted: 17 Feb 2010 12:29
by stevieboy
Hi
Any help appreciated
I have a text file it contains blocks of variable text see example 1 and I would like to edit the file to the format of Example 2

Example1

--------minus signs here

C:\Data\User -lots of spaces here and poss CR /LF


Work\dir1 2nd block appears tabbed

C:\Data\User1 -lots of spaces here and poss CR /LF


Work1\dir1
(109 files)--------this is now the end of the text file
etc etc


Example 2 this is what I would like to see:--

copy C:\Data\User\Work\dir1 *.adm F:\admin
copy C:\Data\User1\Work1\dir1 *.adm F:\admin

Not sure if this is possible have been able to put the copy bit in front of everything but thats it so far

Best Regards

Steve

Re: editing a text file

Posted: 19 Feb 2010 00:04
by BAT Beginner
im also new to coding, but if you want to edit a text file, all i have for a solution is:

Code: Select all

@echo off
cls
del TXTFILENAME.txt
echo. copy C:\Data\User\Work\dir1 *.adm F:\admin > TXTFILENAME.txt
echo. copy C:\Data\User1\Work1\dir1 *.adm F:\admin > TXTFILENAME.txt
ping localhost -n 2 >nul
exit

Re: editing a text file

Posted: 19 Feb 2010 15:03
by stevieboy
thanks for reply my problem was -i have done it now is the stripping of all of the unwanted characters and inserting the extra copy bits
my solution is very complicated and involves 10 bat and some vbs stuff all from the web but now looks good but clunky

thanks again

stevieboy