Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: tarun_agrawal
2,392
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
6,906
Posted By tarun_agrawal
try this xargs -L 2 < filename.txt
try this


xargs -L 2 < filename.txt
4,736
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,048
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
1,882
Posted By tarun_agrawal
try this awk 'NR%4==0{print...
try this


awk 'NR%4==0{print "--------------";next;} {print} END{print "--------------"}' filename
40,546
Posted By tarun_agrawal
try this xargs -i sh -c './shscript {}' <...
try this
xargs -i sh -c './shscript {}' < parameters.txt
804
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)
2,760
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,082
Posted By tarun_agrawal
tr ',' '\n' < filename
tr ',' '\n' < filename
1,579
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
13,488
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,252
Posted By tarun_agrawal
if grep -q "CREATE TABLE" <<<"$line" then ......
if grep -q "CREATE TABLE" <<<"$line"
then
...
fi.
1,252
Posted By tarun_agrawal
good to use if grep -q <search text>...
good to use

if grep -q <search text> <<<"$line"
3,399
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'
797
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

 

Featured Tech Videos

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