# Search Results

 06-24-2014 1,695 Posted By pamu Then try my solution :) Then try my solution :)
 06-24-2014 1,695 Posted By pamu Try \$ awk -F, 'BEGIN{print "record_number ,... Try \$ awk -F, 'BEGIN{print "record_number , columns_with_diff"} NR==FNR{for(i=2;i<=NF;i++){A[\$1,i]=\$i}next}{for(i=2;i<=NF;i++){if(\$i!=A[\$1,i]){p=p?p","i:i}}print \$1,p;p=""}' file1 file2...
 03-26-2014 1,889 Posted By pamu OR \$ awk -F , '!\$4{\$4="BIKE"}1' OFS=","... OR \$ awk -F , '!\$4{\$4="BIKE"}1' OFS="," file 1,abc,55,CAR 3,bb,dd,CAR 5,ddd,tttt,BIKE 8,ee,55,BIKE
 01-28-2014 1,207 Posted By pamu awk 'NR==FNR{A[\$3]++;next}{if(A[\$3] > 1 &&... awk 'NR==FNR{A[\$3]++;next}{if(A[\$3] > 1 && !B[\$3]){B[\$3]++;next} }1' file file 12 NIL ABD LON 12 NIL ABC AMR 13 NIL ABC AMR 11 NIL ABK AMR
 01-08-2014 1,132 Posted By pamu modified your code try key="phani;ravi;kiran"... modified your code try key="phani;ravi;kiran" number_of_keys=\$(echo \$key|awk '{print NF}' FS=';') for (( i = 1; i <= \$number_of_keys; i++ )); do key=\$(echo \$KEY_TO_COMPARE|awk -v var=i 'BEGIN {...
 11-18-2013 1,423 Posted By pamu With some assumptions.. \$ awk -F ">" '{... With some assumptions.. \$ awk -F ">" '{ print \$NF}' file 96427210 861521305 123257583 79634223 861521305 79634223 68404733 861521305 68422718
 11-11-2013 7,006 Posted By pamu if you have date -d option \$ date -d... if you have date -d option \$ date -d "12/03/2013 11:02 AM" +"%d-%b-%Y %R %p" 03-Dec-2013 11:02 AM
 11-08-2013 779 Posted By pamu Try sort -t- -nk3 -k2M -nk1 file Try sort -t- -nk3 -k2M -nk1 file
 10-31-2013 1,117 Posted By pamu try \$ awk -F "'" '/^:4488:/{F=1} /^-\}/{F=0}... try \$ awk -F "'" '/^:4488:/{F=1} /^-\}/{F=0} F{gsub(/[{},]/,"");gsub(FS,"")}1 ! F{print}' file :2020:WITCH13288008772 :4488:20131015INR25000003 :5500:00000060020001752 Mr. Chintan Add1 . ...
 10-24-2013 2,761 Posted By pamu with awk \$ awk 'NR==FNR{A[\$1]++;next}{if(!... with awk \$ awk 'NR==FNR{A[\$1]++;next}{if(! A[\$1]){print }else{A[\$1]=0}}END{for(i in A){if(A[i]){print i}}}' file1 file2 101214700333 101214100500
 10-23-2013 4,322 Posted By pamu No I have given same file as input two times... No I have given same file as input two times that's why it is file file and not file > file If you want to redirect your output to any other file then do like this file file > file_out
 09-24-2013 4,360 Posted By pamu also while read line do ... also while read line do wardevent=\$(expr \$line + 0) # remove leading Zero from the line echo \$wardevent done
 09-19-2013 2,202 Posted By pamu \$ awk 'NR==FNR{a+=\$2;next}{print \$1"/"a}' file... \$ awk 'NR==FNR{a+=\$2;next}{print \$1"/"a}' file file 1/5 2/5 3/5 4/5
 09-12-2013 1,547 Posted By pamu Sorry I've missed few steps. now try ... Sorry I've missed few steps. now try awk 'NR==1{S=strtonum( "0x" \$1 );P=\$1} NR>1{K=strtonum( "0x" \$1 );if((K - S) == 1){S=K;T=\$1}else{print P":"T;P=\$1;S=K}} END{if(T==\$1 &&...
 09-10-2013 773 Posted By pamu If should have space between brackets... can... If should have space between brackets... can reduce one grep and avoid use of back tick's try x=\$(ps -fu myuserid| grep -v grep | awk '/java/{print \$2}') if [ \$x -eq 0 ]
 09-06-2013 1,260 Posted By pamu awk 'FNR==NR{A[NR]=\$0;next}{print A[FNR]""\$0}'... awk 'FNR==NR{A[NR]=\$0;next}{print A[FNR]""\$0}' top_list.txt_temp_1 top_list.txt_temp
 09-06-2013 830 Posted By pamu awk '{for(i=1;i<=NF;i++){if(!A[\$i,NR]++){S=S?S... awk '{for(i=1;i<=NF;i++){if(!A[\$i,NR]++){S=S?S OFS \$i:\$i}}print S;S=""}' OFS="\t" file ID source 1 GM GF 2 GM GF 3 GM GF SF 4 FF 5 FF ...
 09-06-2013 726 Posted By pamu Try awk '/TAG/{a++;next} {print > "File"a}'... Try awk '/TAG/{a++;next} {print > "File"a}' file
 09-05-2013 1,052 Posted By pamu Then remove one OFS from awk code awk... Then remove one OFS from awk code awk 'NR==1{\$1=OFS \$1}1 NR>1{S=\$1;for(i=2;i<=NF;i++){if(\$i != \$1){S=S OFS \$i}}print S;}' OFS="\t" file > file.out
 08-22-2013 4,762 Posted By pamu awk -F ";" '{for(i=1;i<=NF;i++){if(\$i ~... awk -F ";" '{for(i=1;i<=NF;i++){if(\$i ~ /chr|start|stop|symbol|gene_name|protein_name|info/){s=s?s";"\$i:\$i}}print s;s=""}' file
 07-29-2013 668 Posted By pamu Please use code tags for code and data sample. ... Please use code tags for code and data sample. try awk '{ print \$1}' file
 07-17-2013 2,558 Posted By pamu awk -F \| 'NR==FNR{A[\$0]++;next}{if(A[\$1]){print... awk -F \| 'NR==FNR{A[\$0]++;next}{if(A[\$1]){print \$0","FILENAME}}' 2.txt 1.txt
 07-04-2013 7,440 Posted By pamu Please use code tags for code and data sample. ... Please use code tags for code and data sample. awk 'FNR == NR { h[\$1,\$2] = 1; next } h[\$1,\$2]' file1 file2 > output
 07-01-2013 1,969 Posted By pamu Small correction.. awk... Small correction.. awk '{\$0=substr(\$0,1,7)""substr(\$0,9,1)}1' file
 06-27-2013 850 Posted By pamu Hi, I have the files in the following files in... Hi, I have the files in the following files in a folder 19996587342 19487656550 19534838736 And i need to get the first 6 characters from the abvoe files so i used the following script ...
 Showing results 1 to 25 of 465

## Featured Tech Videos

All times are GMT -4. The time now is 10:50 AM.