To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.geekOpen lugnet.off-topic.geek in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Geek / 4102
4101  |  4103
Subject: 
TXT-file question
Newsgroups: 
lugnet.off-topic.geek
Date: 
Wed, 18 Dec 2002 20:38:53 GMT
Viewed: 
520 times
  
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:
  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:



Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR