Discussion:
Newbie: find and replace text string in many small text files
(too old to reply)
mcran
2012-02-20 22:46:34 UTC
Permalink
I'm wanting to find and replace text in a large number of small text
files. Would a batch file work for this?

I've only used batch files for moving files around and merging them -
only a single line of code required - and need some help thinking
round this problem.

thanks in advance for your help and patience.

mark
Wally W.
2012-02-21 00:22:09 UTC
Permalink
Post by mcran
I'm wanting to find and replace text in a large number of small text
files. Would a batch file work for this?
I've only used batch files for moving files around and merging them -
only a single line of code required - and need some help thinking
round this problem.
thanks in advance for your help and patience.
mark
Web search with the words:
find replace dos batch

Some techniques use CMD.EXE instead of COMMAND.COM.

Some may or may not work for you depending on whether and what version
of Windows you are using.
billious
2012-02-21 04:09:31 UTC
Permalink
Post by mcran
I'm wanting to find and replace text in a large number of small text
files. Would a batch file work for this?
I've only used batch files for moving files around and merging them -
only a single line of code required - and need some help thinking
round this problem.
thanks in advance for your help and patience.
mark
First - try using alt.msdos.batch.nt (or alt.msdos.batch if your server
doesn't carry that group, but not both)

There are heaps of examples there about how to do text manipulation.

Second - be more specific. Give some examples. Are you looking for a
particular string, or do you want to transform one string into another, for
instance. Would case be important? Does the required text contain symbols
rather than just alphabetic and numeric characters - especially space,
comma, semicolon, exclamation or question marks, pipes, percent,
greater-than or less-than signs that may have significance to the batch
language itself?

Third - are you able to use third-party utilities, such as SED, AWK or
GAWK - or are you restricted to "pure" batch?

It would also be a good idea to specify your target OS. DOS/9x/ME/NT4- are
rare nowadays. Are you looking at 2000 or later?
Dr J R Stockton
2012-02-21 21:08:00 UTC
Permalink
In alt.msdos message <efa86396-5239-4840-964f-***@b18g2000vbz.g
ooglegroups.com>, Mon, 20 Feb 2012 14:46:34, mcran
Post by mcran
I'm wanting to find and replace text in a large number of small text
files. Would a batch file work for this?
MiniTrue, via sig, will do that well.
--
(c) John Stockton, nr London, UK. ?@merlyn.demon.co.uk Turnpike 6.05 WinXP.
Web <http://www.merlyn.demon.co.uk/> - FAQ-type topics, acronyms, and links.
Command-prompt MiniTrue is useful for viewing/searching/altering files. Free,
DOS/Win/UNIX now 2.0.6; see <URL:http://www.merlyn.demon.co.uk/pc-links.htm>.
Loading...