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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Removing matching text from file?!

Reply to Message Icon

Name: alsvik
Date: December 17, 2004 at 09:53:56 Pacific
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?



Sponsored Link
Ads by Google

Response Number 1
Name: Wolfbone
Date: December 18, 2004 at 14:22:08 Pacific
Reply:

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


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: Removing matching text from file?!

to remove duplicate lines from file www.computing.net/answers/unix/to-remove-duplicate-lines-from-file/7011.html

Remove blank lines from file www.computing.net/answers/unix/remove-blank-lines-from-file/3887.html

removing specific line from file www.computing.net/answers/unix/removing-specific-line-from-file/5042.html