gargamel100
Technical User
Hi all,
usnig this part of code
cat 942prm_200611* | tr ' | ' ' ' > 942sve.txt
awk ' { if(( $10=="30001") && (($22=="34") || ($22=="128") || ($21=="31"))) print $10 "\t" $22 }' 942sve.txt > jacause.txt
awk ' { if(( $10=="30350") && (($22=="31") || ($22=="128") || ($22=="16"))) print $10 "\t" $22 }' 942sve.txt >> jacause.txt
awk ' { if(( $10=="50111") && (($22=="34") || ($22=="128"))) print $10 "\t" $22 }' 942sve.txt >> jacause.txt
I got output like bellow ....
30001 128
30001 128
30001 128
30350 16
30350 16
30350 16
30350 16
30350 31
30350 128
30350 128
30350 31
30350 128
30350 31
30350 16
30350 128
30350 31
30350 31
first column means telephne number and second column menas specific cause for that number. Now I need to implement additional script ( or inside this one ) that will make possible to for example number 30350 select all causes to different files. I need to make output like
in file 30350_128.txt should be
30350 128
30350 128
30350 128
in file 30350_31.txt
30350 31
30350 31
in file 30350_16.txt
30350 16
30350 16
30350 16
30350 16
For number 30001 I need make the same
for example 30001_128.txt
30001 128
30001 128
30001 128
( there is no other causes for this number, just this one )
and for every differnt number in column one write data for specific cause in column 2 into differen file like in example above.
I am hoping that someone know how to do this and have time to write, or just send me an hint how to do this... and help me.
I must do it in awk, no other program languages.
Thank you in advance
Regards
Gargamel100
usnig this part of code
cat 942prm_200611* | tr ' | ' ' ' > 942sve.txt
awk ' { if(( $10=="30001") && (($22=="34") || ($22=="128") || ($21=="31"))) print $10 "\t" $22 }' 942sve.txt > jacause.txt
awk ' { if(( $10=="30350") && (($22=="31") || ($22=="128") || ($22=="16"))) print $10 "\t" $22 }' 942sve.txt >> jacause.txt
awk ' { if(( $10=="50111") && (($22=="34") || ($22=="128"))) print $10 "\t" $22 }' 942sve.txt >> jacause.txt
I got output like bellow ....
30001 128
30001 128
30001 128
30350 16
30350 16
30350 16
30350 16
30350 31
30350 128
30350 128
30350 31
30350 128
30350 31
30350 16
30350 128
30350 31
30350 31
first column means telephne number and second column menas specific cause for that number. Now I need to implement additional script ( or inside this one ) that will make possible to for example number 30350 select all causes to different files. I need to make output like
in file 30350_128.txt should be
30350 128
30350 128
30350 128
in file 30350_31.txt
30350 31
30350 31
in file 30350_16.txt
30350 16
30350 16
30350 16
30350 16
For number 30001 I need make the same
for example 30001_128.txt
30001 128
30001 128
30001 128
( there is no other causes for this number, just this one )
and for every differnt number in column one write data for specific cause in column 2 into differen file like in example above.
I am hoping that someone know how to do this and have time to write, or just send me an hint how to do this... and help me.
I must do it in awk, no other program languages.
Thank you in advance
Regards
Gargamel100