|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Sorting columns for specific values
Dear All, i have a column with values in excel table: Code:
ATGC22327-p66 ATGC15922-p239 ATGC12710-p21743567 ATGC08037-p186 ATGC07969-p173 ATGC07345-p48534 ATGC02767-p254234 ATGC02124-p2177451 ATGC02124-p1459 ATGC01930-p3005 I need to have a new column with only value starting with p, output should be Code:
p66 p239 p21743567 p186 thanks for the help, Best Regards AAWT |
| Sponsored Links | ||
|
|
#2
|
|||
|
|||
|
'in excel table'? Do you mean a CSV file, flat file, or actual xls file?
|
| Sponsored Links | ||
|
|
#3
|
|||
|
|||
|
Yes it is an excel file, I was trying to do in excel by opening text file,
this is actually a tab delimited text file Best Regards |
|
#4
|
|||
|
|||
|
Quote:
Knowing which column you wanted would also be nice... I'm assuming it's the first and only column, but 'tab separated' has little meaning when there's no columns! Code:
awk -F"-" '{ print $2 }' inputfile |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
Follow these steps:
|
| The Following User Says Thank You to Yoda For This Useful Post: | ||
AAWT (03-14-2013) | ||
| Sponsored Links | |
|
|
#6
|
|||
|
|||
|
thanks, it works in excel,
but not in text file, it was second column, Best Regards |
| Sponsored Links | |
|
|
#7
|
|||
|
|||
|
Import the text into excel, nsert a blank column to the right of the column with the -p's, select the text, and do data text to columns, spliting on '-', as mentioned above.
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Adding columns with values dependent on existing columns | plumb_r | Shell Programming and Scripting | 2 | 02-05-2013 01:51 AM |
| Print columns matching to specific values | EAGL€ | Shell Programming and Scripting | 3 | 06-07-2012 08:50 AM |
| Removing columns from a text file that do not have any values in second and third columns | evelibertine | UNIX for Dummies Questions & Answers | 3 | 11-22-2011 03:53 PM |
| Get values from different columns from file2 when match values of file1 | cgkmal | Shell Programming and Scripting | 17 | 09-29-2011 05:03 AM |
| Sorting multi-column values from a specific file | canimsin | Shell Programming and Scripting | 4 | 09-22-2010 08:13 AM |
|
|