Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Newbie: find and replace text string in many small text files

5 views
Skip to first unread message

mcran

unread,
Feb 20, 2012, 5:46:34 PM2/20/12
to
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.

unread,
Feb 20, 2012, 7:22:09 PM2/20/12
to
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

unread,
Feb 20, 2012, 11:09:31 PM2/20/12
to

"mcran" <cranme...@gmail.com> wrote in message
news:efa86396-5239-4840...@b18g2000vbz.googlegroups.com...
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

unread,
Feb 21, 2012, 4:08:00 PM2/21/12
to
In alt.msdos message <efa86396-5239-4840-964f-43612c995dec@b18g2000vbz.g
ooglegroups.com>, Mon, 20 Feb 2012 14:46:34, mcran
<cranme...@gmail.com> posted:

>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>.
0 new messages