Search Results

Search: Posts Made By: raj_saini20
1,497
Posted By raj_saini20
Try this Third field move to last, if required in...
Try this Third field move to last, if required in order can be done

awk -F"|" '(!a[$1"|"$2"|"$4]){a[$1"|"$2"|"$4]=$3;next}{if(a[$1"|"$2"|"$4] < $3){a[$1"|"$2"|"$4]=$3}}END{for( i in a) { print...
2,984
Posted By raj_saini20
try this (copy in file and run) awk ' ...
try this (copy in file and run)



awk '
NR==FNR&&NF>1{
x=$1;
for(i=2;i<NF;i++)
{
x=substr(x,1)":"substr($i,1);
};
a[x]=$NF
}
(NR!=FNR&&NF>1){
x=$1;...
1,170
Posted By raj_saini20
awk -F">" '{for(i=1;i<=NF;i++){split($i,b,"...
awk -F">" '{for(i=1;i<=NF;i++){split($i,b," ");if(i==1){x=b[1];y=b[2];continue}; print x" "y" "FS b[1];y=b[2]}}' filename
1,774
Posted By raj_saini20
awk -F"\"" '/^share/{n=split($NF,a,"=");print...
awk -F"\"" '/^share/{n=split($NF,a,"=");print "\\"a[n]"\\"$2","$4}' filename
4,083
Posted By raj_saini20
here is modified pravin27's code awk...
here is modified pravin27's code

awk 'NR==FNR{f1=substr($0,1,index($0,".")-1);a[f1]=$0;next}
{if(a[$1]){print $2,$3,$4,a[$1]}else{print $2,$3,$4,"none.gif"}}' file2 file1
2,218
Posted By raj_saini20
awk 'NF==0{f=0;printf "\n";next}{if(f==1){printf...
awk 'NF==0{f=0;printf "\n";next}{if(f==1){printf "="$1}else{f=1;printf $1}}' filename
5,061
Posted By raj_saini20
awk...
awk 'FNR==4{split(FILENAME,a,"_");dt=a[6]"_"a[7]"_"substr(a[8],1,4);print dt","$0}' Bounce*
12,032
Posted By raj_saini20
while read f_name do awk 'BEGIN{f=0} ...
while read f_name
do
awk 'BEGIN{f=0}
(/^<FORMINFO /){
var="FORMINFO/";
for(i=2;i<=NF;i++)
{
split($i,a,"=");
print a[1]" /"var"@"a[1]
}
f=1;
next
}
(f==1){...
981
Posted By raj_saini20
use cron for this
use cron for this
1,213
Posted By raj_saini20
ls thread* | awk '{print "mv "$1"...
ls thread* | awk '{print "mv "$1" "substr($1,8,2)substr($1,14,4)".arc"}' | sh
1,089
Posted By raj_saini20
remove " commas from b[1] put arround only "is...
remove " commas from b[1] put arround only "is good" and use b[2] to print bcd
4,525
Posted By raj_saini20
try using gsub on $0 of file2
try using gsub on $0 of file2
1,612
Posted By raj_saini20
try this for BLOCK in /sys/block/myblock?* ...
try this

for BLOCK in /sys/block/myblock?*
do
echo "100000" > "$BLOCK"/abcd

done
3,514
Posted By raj_saini20
i had made some changes to your awk command ...
i had made some changes to your awk command

awk -F"," '{
if($10 > 400)
print substr($1, 4, 2) "/" substr($1, 1, 2) "/" substr($1, 9, 2) "-"...
1,748
Posted By raj_saini20
awk...
awk 'BEGIN{i=1}{if(a[$1]){a[$1]=a[$1]FS$2;b[$1]=b[$1]FS$3}else{a[$1]=$2;b[$1]=$3;c[i]=$1;i++}}END{for(j=1;j<i;j++){print c[j],a[c[j]],b[c[j]]}}' file
3,770
Posted By raj_saini20
awk 'NR==FNR{a[$1]=$2;next}(a[$1]){print...
awk 'NR==FNR{a[$1]=$2;next}(a[$1]){print $0,a[$1]}' file2 file1


output is

950 0.0 1612.0 -163.34
950 212.0 1762.0 -163.34
950 488.0 1912.0 -163.34
950 772.0 2024.0 -163.34
950 1032.0...
7,671
Posted By raj_saini20
awk 'BEGIN {FS="[/,:...
awk 'BEGIN {FS="[/,: ]"}{$4=($6=="PM"?($4==12?$4:$4+12):($4==12?0:$4)); $6=""} {print $1"/"$2"/"$3","$4":"$5}'

for 24Hrs conversion
12,032
Posted By raj_saini20
try this awk 'BEGIN{f=0} (/^<FORMINFO /){ ...
try this

awk 'BEGIN{f=0}
(/^<FORMINFO /){
var="FORMINFO/";
for(i=2;i<=NF;i++)
{
split($i,a,"=");
print a[1]" /"var"@"a[1]
}
f=1;
next
}
(f==1){...
1,400
Posted By raj_saini20
awk...
awk 'BEGIN{i=1;s=0}{a[i]=$0;s+=$2;i++}END{for(j=1;j<i;j++){split(a[j],b);print a[j],b[2]/s}}' infile
12,032
Posted By raj_saini20
awk 'BEGIN{f=0} (/^<ROW /){ ...
awk 'BEGIN{f=0}
(/^<ROW /){
split($0,a,"\"");
print "ROW_NUM /ROWSET/ROW/@num";
f=1;
next
}
(f==1){
if(/^<\/ROW/)
{
f=0
}
else
{
split($0,a,"<|>");
print...
12,032
Posted By raj_saini20
awk 'BEGIN{f=0} (/^<ROW /){ ...
awk 'BEGIN{f=0}
(/^<ROW /){
split($0,a,"\"");
print "ROW_NUM/ROWSET/ROW/@"a[2];
f=1;
next
}
(f==1){
if(/^<\/ROW/)
{
f=0
}
else
{
split($0,a,"<|>");
print...
1,362
Posted By raj_saini20
here is corrected one awk -v...
here is corrected one

awk -v p="1-2,4-13,16,19-20,21-25,31-32" -v dn="file.pdf" 'BEGIN{ORS=" ";n=split(p,t,",");for (i=1;i<=n;i++) if(t[i] ~ /-/) {split(t[i],t1,"-"); print "-dFirstPage=" t1[1]...
1,588
Posted By raj_saini20
ls prepaid_[0-9][0-9][0-9].txt | grep -v -f...
ls prepaid_[0-9][0-9][0-9].txt | grep -v -f xxx.txt
3,722
Posted By raj_saini20
modify {A[a++]=gsub(/...
modify

{A[a++]=gsub(/ /,"",substr($0,2,16))}

as

{x=substr($0,2,16);gsub(/ /,"",x);A[a++]=x}
2,125
Posted By raj_saini20
try this awk 'BEGIN{i=1; while (getline <...
try this

awk 'BEGIN{i=1; while (getline < "bimfile")
{
if(match($5,$6))
{
ind=i":"$5;
a[ind]=0;
ind=i":"$6;
a[ind]=0;
i++
}
else
{...
Showing results 1 to 25 of 39

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