editing a text file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
stevieboy
Posts: 2
Joined: 17 Feb 2010 12:09

editing a text file

#1 Post by stevieboy » 17 Feb 2010 12:29

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

BAT Beginner
Posts: 16
Joined: 29 Jan 2010 17:19

Re: editing a text file

#2 Post by BAT Beginner » 19 Feb 2010 00:04

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

stevieboy
Posts: 2
Joined: 17 Feb 2010 12:09

Re: editing a text file

#3 Post by stevieboy » 19 Feb 2010 15:03

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

Post Reply