Search Results

Search: Posts Made By: charles33
53,649
Posted By Corona688
awk obviously does what you want: $ printf...
awk obviously does what you want:

$ printf "\tASDF\n" | awk -F'\t' '$1' # Ignore lines where first field is blank

$ So, your data doesn't seem to be what you think it is.As such, using a...
53,649
Posted By Scrutinizer
Some options: awk -F'\t' '$1!=""' infile or ...
Some options:
awk -F'\t' '$1!=""' infile
or
awk -F'\t' 'x$1' infile
You can use single quotes to protect \t from interpretation by the shell..

-or just-
awk '!/^\t/' infile
for the first...
2,349
Posted By birei
Other way: $ awk 'BEGIN { FS = "," } $3 ~...
Other way:

$ awk 'BEGIN { FS = "," } $3 ~ /F-/ { print $0 ",\"Female\""; next } $3 ~ /M-/ { print $0 ",\"Male\""; next } { print $0 ",\"Unknown\"" }' infile...
2,349
Posted By ahamed101
Something similar... awk -F, ' ...
Something similar...

awk -F, '
$3~"F-\""||$7~"F-\""{print $0OFS"\"Female\"";next}
$3~"M-\""||$7~"M-\""{print $0OFS"\"Male\"";next}
{print $0 OFS"\"Unknown\""} ' OFS=, infile


--ahamed
...
2,349
Posted By agama
Something like this should work: awk '...
Something like this should work:



awk '
{
if( match( "F-", $3 $7 ) )
s = "Female";
else
if( match( "M-", $3 $7 ) )
s = "Male";
...
9,299
Posted By ahamed101
You are right!... --ahamed
You are right!...

--ahamed
9,299
Posted By rdcwayx
awk '/2011-11-05/ {$6=$5}1' FS=, OFS=, File1.txt ...
awk '/2011-11-05/ {$6=$5}1' FS=, OFS=, File1.txt
You can refer it to finish your second request.
20,509
Posted By ahamed101
grep -vf vitallog.txt vitalinfo.txt >...
grep -vf vitallog.txt vitalinfo.txt > vitalfiltered.txt



awk -F, 'NR==FNR{_1[$1]++;next}!_1[$1]' vitallog.txt vitalinfo.txt > vitalfiltered.txt

--ahamed
3,901
Posted By kato
awk -F, '{a[$1]++} END{for(row in a)...
awk -F, '{a[$1]++} END{for(row in a) if(a[row]==1) print row}' file*
Showing results 1 to 9 of 9

 
All times are GMT -4. The time now is 02:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy