Computing.Net > Forums > Unix > Removing matching text from file?!

Removing matching text from file?!

Reply to Message Icon

Original Message
Name: alsvik
Date: December 17, 2004 at 09:53:56 Pacific
Subject: Removing matching text from file?!
OS: Windows XP SP 2
CPU/Ram: 2800 / 512
Comment:

I need a simpel UNIX command that can remove some tagged text from a file.

The file looks likes this:

To/NUM kendte/ADJ russiske/ADJ historikere/N Andronik/EGEN Mirganjan/EGEN og/SKONJ Igor/EGEN Klamkin/EGEN tror/V_PRES ikke/ADV ,/TEGN at/UKONJ Rusland/EGEN kan/V_PRES udvikles/V_INF uden/PRÆP en/PRON_UBST "/TEGN jernnæve/N "/TEGN.

What i need to remove is the /XXX from the text, but i need to maintain the punctuation and the rest of thne text.

How can i do this?


Report Offensive Message For Removal

Response Number 1
Name: Wolfbone
Date: December 18, 2004 at 14:22:08 Pacific
Subject: Removing matching text from file?!
Reply: (edit)

awk '{gsub(/\/[[:upper:]_]+/,""); print}'


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Removing matching text from file?!

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software