File search and string removal ? 
Author Message
 File search and string removal ?

Hi

I was wondering if there was a web site for awk FAQS (Frequently
Asked Questions). I also had a question about how to open a
file then search through it delete a substring that occurs
many times. Please direct me to the web site or if you have any
suggestions please pass them to me.

Thanks



Fri, 28 Jan 2000 03:00:00 GMT  
 File search and string removal ?


Quote:

> I was wondering if there was a web site for awk FAQS (Frequently
> Asked Questions). I also had a question about how to open a
> file then search through it delete a substring that occurs
> many times. Please direct me to the web site or if you have any
> suggestions please pass them to me.

sed's better at this.  If your substring is 'substring', try:

sed 's/substring//g' yourfile >yourfile.done

If you don't have sed, heck, try your text editor.

If you really want awk, try:

awk '{ gsub(/substring/, "", $0); print $0; }' yourfile >yourfile.done

--
Jeremy Brinkley
System Administrator
Stanford {*filter*} Center

finger for PGP key (2.6.2)
Jeremy Brinkley
System Administrator
Stanford {*filter*} Center

finger for PGP key (2.6.2)



Fri, 28 Jan 2000 03:00:00 GMT  
 File search and string removal ?

to delete
sed would do

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    for a 1stop sed needs, join seders, the informal sed mailing list.      
    sed is literate.  sed knows 4 R's: read, 'rite, 'rithmetic, recur.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

                        sed informal mailing list

        Of half a dozen sed studs known to sedkind, seders has 2   :
                Greg Ubben       +      Carlos J. G. Duarte.
                               -----

                   sed web pages (in 4 countries)

http://www.wollery.demon.co.uk   seders grab bag (seders official web page
                                                              seder  Casper
http://www.math.fu-berlin.de/~guckes/sed/          seder, Herr Guckes
http://www.math.fu-berlin.de/~leitner/sed/          seder, Herr von Leitner
http://www.dbnet.ece.ntua.gr/~george/#seders  seder, engineer, Dr2b Yiorgos
ftp://olivia.inesc.pt/pub/users/cdua/scripts/sed         the great sed stud
ftp://olivia.inesc.pt/pub/users/cdua/scripts/sh   seder Carlos J. G. Duarte
                                ----

             my favourite DOS/UNIX sed15 (with C source)
(easily compilable for UNIX.  has friendly extenstions/relaxations like hex)
 ftp://uiarchive.uiuc.edu/pub/systems/pc/simtelnet/msdos/txtutl/sed15.zip
 ftp://uiarchive.uiuc.edu/pub/systems/pc/simtelnet/msdos/txtutl/sed15x...

Directory: /pub/systems/pc/simtelnet/msdos/txtutl/
Filename    Type Length  Date    Description
===============================================================================
sed15.zip    B    62082  910930  Unix-compatible streaming editor v1.5 TC src
sed15x.zip   B    20300  910930  Unix-compatible streaming editor v1.5 EXE/docs

              sed15.zip has C source, compilable for UNIX.

             Also, check simtel for u-sedit. has nice docs.

                                ----

                O'Reilly sed books http://www.ora.com
1- sed and awk 2nd edition         by   Dale Dougherty  +  Arnold Robbins
        (mostly for awk)
2- mastering regular expressions   by          Jeffrey E. F. Friedl
        (mostly for perl, emacs, awk.  but touches on sed)

                                ----
                   newsgroup alt.comp.editors.batch      
      though seders news group, alt.comp.editors.batch deals with
batch, AI, data warehousing, OLAP, computer security, filters, linguistics,
      awk, perl, unix, computer seminars, CFP, etc (even sed)

           started by a seder, PhD2b, engineer, the hawk
                         Yiorgos Adamopoulos.    

          most newsfeeds do not carry alt.comp.editors.batch
          but everyone can get it via  dejanews (and others)
  you can even follow up, reply to the poster, etc.  dejanews is great.
             (then he sed: not by sed alone ... lives man)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

: Hi

: I was wondering if there was a web site for awk FAQS (Frequently
: Asked Questions). I also had a question about how to open a
: file then search through it delete a substring that occurs
: many times. Please direct me to the web site or if you have any
: suggestions please pass them to me.

: Thanks
--
=-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
al aab, seders moderator                                      sed u soon
               it is not zat we do not see the  s o l u t i o n          
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-+



Sat, 05 Feb 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. TSO Rexx to search file for string

2. searching and replacing a string within a file with rexx

3. search string in binary file

4. Search for a string in binary files

5. Search a string in a string

6. Searching for a string inside a string

7. File Drop Combo Removal

8. F77: Existing file Removal?

9. searching one file using the contents of another file

10. number of records for tps file and searching files

11. how to read the strings form a spread sheet file back into LABVIEW as strings

12. String search

 

 
Powered by phpBB® Forum Software