Search Results

Search: Posts Made By: tarun_agrawal
2,609
Posted By tarun_agrawal
I hope this will anwer your query awk ...
I hope this will anwer your query


awk 'NR==FNR{a[$1]=$1;next} {for(v in a){ print v","$0 | "sort -n -k1" }}' file1 file2
7,394
Posted By tarun_agrawal
try this xargs -L 2 < filename.txt
try this


xargs -L 2 < filename.txt
10,149
Posted By tarun_agrawal
records_in_1_not_2.txt join -t"," -1 1 -2...
records_in_1_not_2.txt


join -t"," -1 1 -2 1 -v 1 <(sort -t "," file1) <(sort -t"," file2)



records_in_2_not_1.txt


join -t"," -1 1 -2 1 -v 2 <(sort -t "," file1) <(sort -t"," file2)...
1,435
Posted By tarun_agrawal
try this awk 'NR==1{;a=$0}...
try this


awk 'NR==1{;a=$0} NR>1{for(i=1;i<NF;i++) {v=$(i+1);r=$1;b=$0;$0=a;c=$i;$0=b;print r c":"v }; }' file
2,312
Posted By tarun_agrawal
try this awk 'NR%4==0{print...
try this


awk 'NR%4==0{print "--------------";next;} {print} END{print "--------------"}' filename
45,476
Posted By tarun_agrawal
try this xargs -i sh -c './shscript {}' <...
try this
xargs -i sh -c './shscript {}' < parameters.txt
978
Posted By tarun_agrawal
join -1 1 -2 2 <(sort -n -k1 1.tmp) <(sort -n...
join -1 1 -2 2 <(sort -n -k1 1.tmp) <(sort -n -k2 1.res)
3,179
Posted By tarun_agrawal
Code: $ grep -f pattern_filename filename ...
Code:
$ grep -f pattern_filename filename
where pattern_filename look like:
pattern1
pattern2
....
....
patternn
2,634
Posted By tarun_agrawal
tr ',' '\n' < filename
tr ',' '\n' < filename
1,887
Posted By tarun_agrawal
hope this will help you. awk -F"/"...
hope this will help you.
awk -F"/" '{a="";for(i=1;i<=NF;i++){print a""$i;a=(a "-")}}' filename.txt
14,344
Posted By tarun_agrawal
echo "1 2 3 3 2 1" | xargs -n 1 | awk '{a[$0]++}...
echo "1 2 3 3 2 1" | xargs -n 1 | awk '{a[$0]++} END{for(i in a) {print i , a[i]} }'
1,537
Posted By tarun_agrawal
good to use if grep -q <search text>...
good to use

if grep -q <search text> <<<"$line"
1,537
Posted By tarun_agrawal
if grep -q "CREATE TABLE" <<<"$line" then ......
if grep -q "CREATE TABLE" <<<"$line"
then
...
fi.
4,145
Posted By tarun_agrawal
echo "1 2 3 4 5 6 7 9 12" | awk -v var=2...
echo "1 2 3 4 5 6 7 9 12" | awk -v var=2 '{for(i=3;i<=NF;i=i+3) {$i= $i*var} }1'
952
Posted By tarun_agrawal
With AWK awk -vfile=abc.csv...
With AWK
awk -vfile=abc.csv '{sub(/(\.csv|\.txt.).*$/,".txt",file);print file}' <<<""
Showing results 1 to 15 of 15

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