Re: Editing text file
- From: Ted Davis <tdavis@xxxxxxx>
- Date: Fri, 17 Apr 2009 15:08:34 -0500
On Fri, 17 Apr 2009 10:29:15 -0700, Bojan wrote:
Hi,
I want to change a version number in 4 text files. The 4 files are not
the same, but the changes will be the same. For example. I want to
change "version 1.0" to "version 1.1". The files do have more information
than this and that information should remain unchanged, and the location
of version 1.0 is not always the same in the file.
Is it possible to do this for all the files at once? If it is not, how
would u do it for one file at a time?
I'd use gsar (general search and replace -
<http://gnuwin32.sourceforge.net/packages/gsar.htm>), or an awk of sed
script. Being me, I'd actually do it with gawk:
for %A in (file list) do ( gawk "{gsub(/version 1.0/, \"version
1.1\");print $0}" %A > other_directory\%A)
--
T.E.D. (tdavis@xxxxxxx)
.
- Follow-Ups:
- Re: Editing text file
- From: Bill Buckels
- Re: Editing text file
- References:
- Editing text file
- From: Bojan
- Editing text file
- Prev by Date: Re: Editing text file
- Next by Date: Re: Editing text file
- Previous by thread: Re: Editing text file
- Next by thread: Re: Editing text file
- Index(es):
Relevant Pages
|