Subject:
|
TXT-file question
|
Newsgroups:
|
lugnet.off-topic.geek
|
Date:
|
Wed, 18 Dec 2002 20:38:53 GMT
|
Viewed:
|
457 times
|
| |
![Post a public reply to this message](/news/icon-reply.gif) | |
Hello all:
I have a bunch of text files, each of which contains a character sequence
(say, ABCD) that I need to change (say, to WXYZ). The character sequence is
within the body of each file, rather than the title. Is there an easy
method of swapping out the ABCD's for the WXYZ's without manually opening
each file and doing a find/replace?
Thanks once again to all my geek-savvy friends!
Dave!
|
|
Message has 1 Reply: ![](/news/x.gif) | | Re: TXT-file question
|
| (...) Are you on windows? (if so I don't know) or on UNIX/linux? If you're on UNIX or linus you could use sed. Somethign like: (this is untested so YMMV) for FILE in *.txt; do if sed 's/ABCD/WXYZ/g' < $FILE >$FILE.new; then mv $FILE.new $FILE else (...) (22 years ago, 18-Dec-02, to lugnet.off-topic.geek)
|
13 Messages in This Thread: ![You are here](/news/here.gif) ![](/news/46.gif) ![Re: TXT-file question -Kyle McDonald (18-Dec-02 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: TXT-file question -Dan Boger (18-Dec-02 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: TXT-file question -Dave Schuler (18-Dec-02 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/246.gif) ![Re: TXT-file question -Christopher Tracey (18-Dec-02 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: TXT-file question -Richard Marchetti (20-Dec-02 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: TXT-file question -Christopher Tracey (21-Dec-02 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: TXT-file question -Dan Boger (23-Dec-02 to lugnet.off-topic.geek)](/news/x.gif)
![](/news/x.gif) ![](/news/x.gif) ![](/news/268.gif) ![Re: TXT-file question -David Eaton (18-Dec-02 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: TXT-file question -Thomas Wölk (19-Dec-02 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: TXT-file question -David Eaton (19-Dec-02 to lugnet.off-topic.geek)](/news/x.gif) ![](/news/46.gif) ![Re: TXT-file question -Thomas Wölk (19-Dec-02 to lugnet.off-topic.geek)](/news/x.gif)
![](/news/x.gif) ![](/news/x.gif) ![](/news/68.gif) ![Re: TXT-file question -Ross Crawford (18-Dec-02 to lugnet.off-topic.geek)](/news/x.gif)
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|