![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Conditional FTP | Dastard | Shell Programming and Scripting | 2 | 06-21-2008 04:38 AM |
| conditional email | ricky007 | Shell Programming and Scripting | 3 | 03-05-2008 10:38 PM |
| conditional statement | lalelle | Shell Programming and Scripting | 8 | 08-21-2007 05:57 AM |
| conditional split | braindrain | Shell Programming and Scripting | 5 | 03-11-2006 12:54 AM |
| Conditional Statements | cstovall | Shell Programming and Scripting | 1 | 05-15-2005 02:58 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
AWK - conditional cause
Hello guys,
I want to make a conditional cause in the following file using awk: awk '{ if ($2 != 0) print $1, $2, $3}' test.csv > test2.csv FILE EXAMPLE = test.csv string,number,date abc,0,20050101 def,1,20060101 ghi,2,20040101 jkl,12,20090101 mno,123,20020101 pqr,1234,20020101 stu,0,20000101 However i always get in test2.csv the same content of test.csv. Does anyone know what is the problem with my statment? Best Regards |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
Code:
awk -F, 'BEGIN {OSF=","} { if ($2 != 0) print $1, $2, $3}' test.csv > test2.csv
|
|
#3
|
|||
|
|||
|
thanks Jim...
|
|||
| Google The UNIX and Linux Forums |