|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Can grep search a specific column?
I need to grep a specific column from input with multiple columns. See sample in below:
A B C D E ==================== 1 A2 23 A0 A155 2 A1 01 A6 A090 3 A3 10 A1 A015 4 A0 11 A2 A220 5 A4 33 A5 A130 6 A9 06 A3 A085 7 A5 09 AA A060 As above table, I just want to grep A0 from column D, which gives me the following 1 A2 23 A0 A155 Thanks in advance for your help! |
|
#2
|
|||
|
|||
|
Code:
awk ' { if($4=="A0") print $0} ' myfile
|
|
#3
|
||||
|
||||
|
Quote:
mmmmhhh if you anyway want use awk (i personally prefer the faster sed) show what awk can: Quote:
![]()
__________________
working on Solaris[5-9], preferred languages french and C. Last edited by guggach : March 2nd, 2005 at 01:59 PM. |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Can grep search a specific column? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|