Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2010
    Posts
    40

    Unanswered: Unix command to get rid of last n words

    hi all ...In order to extract the field names of a table in one row separating it with comma I used awk and sed. But I need all the columns except the last 3 and I am not sure how to do that . I tried it in the awk part of the command as well as in the sed part. But I am failing to achieve the required result. Can somebody suggest what would be the best way to achieve this

    Thanks

  2. #2
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    There is a paucity of info here, but
    Code:
    IFS=,
    read a b c d e f g h i j
    echo $a,$b,$c,$d,$e,$f

Posting Permissions

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