If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Unix command to get rid of last n words

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-06-12, 19:20
smritidb2 smritidb2 is offline
Registered User
 
Join Date: Nov 2010
Posts: 26
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
Reply With Quote
  #2 (permalink)  
Old 02-07-12, 08:29
kitaman kitaman is offline
Papabi's friend
 
Join Date: Sep 2009
Location: Ontario
Posts: 629
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On