Find the answer to your Linux question:
Results 1 to 5 of 5
That's right yet another stupid noob thread asking a stupid and pointless question But if you could please take a split second to answer this simple (I think) question that ...
  1. #1
    Just Joined!
    Join Date
    Nov 2010
    Posts
    3

    Noob linux command question

    That's right yet another stupid noob thread asking a stupid and pointless question

    But if you could please take a split second to answer this simple (I think) question that I have been trying to figure out for awhile...that would be awesome!

    I'm sorting through a very large text file. I have sorted out which piece of information that I need via "cat, grep, awk" and I want to sort it better.

    But the one word I'm "printing" out is enclosed with "( )" - how do I remove those damn parenthesis...I do not want them there?

    my command thus far is:

    cat people.txt | grep sam | grep address | awk '{print$1" "$2" "$3"}'

    I get:

    sam (xxx address) 55

    I want:

    sam xxx address 55

    *I have tried messing around with sed, but I can't figure out the proper syntax*

    btw, Happy Turkey day!

  2. #2
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,096
    Can you post an example of an original line?
    You must always face the curtain with a bow.

  3. #3
    Just Joined!
    Join Date
    Nov 2010
    Posts
    3
    You lost me at original line.

    Do you mean like a line from the raw text file? If yes, then no I can't. At least not anytime soon.

  4. #4
    Linux Guru Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    2,096
    Yes, from the raw text file.

    I am not interested in actual data, just in the format.
    Where are numbers, chars, spaces, etc.

    Because it may be possible to simplify the command.

    Anyway, you can strip the () with that
    Code:
     | sed -e s/\(//g -e s/\)//g
    You must always face the curtain with a bow.

  5. #5
    Just Joined!
    Join Date
    Nov 2010
    Posts
    3
    Awesome man! That did the trick

    Exactly what I was looking for.

    thanks again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...