Search Results

Search: Posts Made By: kekanap
1,448
Posted By blackrageous
How many lines in each of these files? If each...
How many lines in each of these files? If each of these files have more than one line, are all the FIELD 12's the same? I don't see your sample file that you say is attached.
1,448
Posted By jim mcnamara
How many lines from the files are in the single...
How many lines from the files are in the single line above? grep returns the file name : then the line in the file. # example:
filename:[line with the matching item] I see several colons on the...
1,448
Posted By blackrageous
It helps if you were to specify the actual field...
It helps if you were to specify the actual field delmiter and a sample of the file instead of the grep.

It seems you are using , (comma as the field delimiter)
So

awk -F\, "{print $12}"...
1,448
Posted By Kibou
I am sure it must be a more elegant solution and...
I am sure it must be a more elegant solution and more efficient.

If I understood correctly, you want to rename the file BW*2014*.csv if the field 12 is "No" and remove those lines matching.

#...
1,448
Posted By Akshay Hegde
Remove BEGIN block it should work, its executed...
Remove BEGIN block it should work, its executed before reading anything

This was supposed to be

echo -e "a b c\nd e f\ng h i" | awk '$2 != "e"{exit 2}'; echo $?

---------- Post updated at...
1,216
Posted By RavinderSingh13
Hello kekanap, Following may help you. ...
Hello kekanap,

Following may help you.


awk -F"," '{$4=$7=$39} 1' OFS="," Input_file


NOTE: This is not tested code.

Thanks,
R. Singh
1,162
Posted By itkamaraj
did you miss 's/sed -i...
did you miss 's/sed -i 's/*pax1.csv:BW-CDR/BW-CDR/g' pax1.csv
957
Posted By RudiC
Try awk ' {for (i=0; i<=3; i++)...
Try awk ' {for (i=0; i<=3; i++) S[i]+=$(ST+i)*SGN}
END {printf "MHG - Inbound Final\t"; for (i=0; i<=3; i++) printf "%s\t", S[i]; printf "\n"}
'...
841
Posted By SriniShoo
Add the below command to your command awk...
Add the below command to your command
awk '{sub("@", "A@", $2)}1' FS=','

cat investigate.csv |grep "BSO,BST,PGWI"| cut -f24,28 -d"," | sort -u | awk '{sub("@", "A@", $2)}1' FS=','

You can...
730
Posted By jacobs.smith
awk '{print $1}' inputfile > output
awk '{print $1}' inputfile > output
1,078
Posted By CarloM
You want the highest field 2 value for each...
You want the highest field 2 value for each unique field 1? (If so, your output data appears to be missing a few rows, e.g. for 335550)

You could do something like:
awk '{ if ($2 > rates[$1]) {...
1,078
Posted By ni2
Are some numbers are missing from your output? ...
Are some numbers are missing from your output?

$ sort -u -r -n <input file>
415550 0.21
335550 0.28
315550 0.28
215650 0.28
130650 0.22
125550 0.28
122850 0.22
120650 0.22
105550 0.28...
912
Posted By anbu23
What have you tried?
What have you tried?
1,105
Posted By Scrutinizer
Try: awk '{sub(/..$/,"-&",$9);...
Try:
awk '{sub(/..$/,"-&",$9); sub(/..-/,"-&",$9)}1' FS=, OFS=, file
1,105
Posted By bartus11
Try:perl -F, -ape...
Try:perl -F, -ape '$F[8]=~s/(\d{4})(\d\d)(\d\d)/$1-$2-$3/;$_=join ",", @F' input
2,874
Posted By bartus11
Please submit new thread for this new problem.
Please submit new thread for this new problem.
1,093
Posted By Akshay Hegde
Your file is not comma separated for given...
Your file is not comma separated

for given input this should work

$ awk 'NR==1{$0=$0 OFS "Prefix"}1' file

if your real data is comma separated use following

$ awk 'NR==1{$0=$0 OFS...
2,256
Posted By jim mcnamara
Did you mean- awk -F"," '/",Call Forward...
Did you mean-

awk -F"," '/",Call Forward Not Reachable"/, { T=$4 ; $4=$36 ; $36=T } 1' *2013*

Input appears to be a csv file.
2,256
Posted By PikK45
grep ",Call Forward Not Reachable" *2013* | awk...
grep ",Call Forward Not Reachable" *2013* | awk 'BEGIN{OFS=FS=","}; {a=$4; $4=$36; $36=a;}1'
2,256
Posted By Corona688
awk -F"," -v OFS="," '{ T=$4 ; $4=$36 ; $36=T }...
awk -F"," -v OFS="," '{ T=$4 ; $4=$36 ; $36=T } 1'
1,648
Posted By juzz4fun
How about this? awk -F',' '$14~/910[0123] &&...
How about this?
awk -F',' '$14~/910[0123] && $42 != 0' *_201304*.csv | wc -l > pax1

Here 910[0123] will evaluate to 9100, 9101, 9102, 9103

regards,
juzz4fun
1,648
Posted By Fundix
awk -F',' ' if ($14==9101' && $42!=0) '...
awk -F',' ' if ($14==9101' && $42!=0) ' *_201304*.csv|wc -l > pax1
1,648
Posted By juzz4fun
Create a script: for i in *_201304*.csv do...
Create a script:

for i in *_201304*.csv
do awk -F',' '$14~/910[0123]/ && $42 != 0' $i | wc -l >> parx1
done

Hope this helps..
1,648
Posted By juzz4fun
Looks difficult for me to express all these using...
Looks difficult for me to express all these using single regexp/pattern, but surely you can do that using multiple awk.
2,434
Posted By Subbeh
You forgot the pipes in the regex: $14 ~...
You forgot the pipes in the regex: $14 ~ /9100|9101|9102|...
Showing results 1 to 25 of 27

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