Search Results

Search: Posts Made By: sdf
1,165
Posted By RudiC
Show us your attempts! ---------- Post...
Show us your attempts!

---------- Post updated at 15:41 ---------- Previous update was at 15:36 ----------

Howsoever, tryawk '/Estimate|realized/ {printf "%s%s ", $1, FS} /USD|Date:/' FS=":"...
3,907
Posted By RudiC
Try awk ' NR==FNR {a[$0] ...
Try awk '
NR==FNR {a[$0]
next
}
{for (i in a) {m=split (i, b, " ")
for (j=1; ($0 ~ b[j]) && j<=m;...
23,705
Posted By Jotne
awk -F"[a-z=&\"]*" '{print $2,$3,$4}' infile 70...
awk -F"[a-z=&\"]*" '{print $2,$3,$4}' infile
70 15481 6991901
7078 15482 70121
709 15484 70183944

@Yoda
I get this with your solution
70 15481 6991901
7078 15482 70121 é
709 15484 70183944
23,705
Posted By Yoda
Here is an awk approach: awk...
Here is an awk approach:
awk '{gsub(/[[:punct:]]+|[[:alpha:]]+/," ");sub(/^[ ]*/,x);NF-=2}1' file
1,422
Posted By guruprasadpr
Hi awk -v p="1-2,4-13,16,19-20,21-25,31-32"...
Hi

awk -v p="1-2,4-13,16,19-20,21-25,31-32" -v dn="file.pdf" 'BEGIN{ORS=" "; x=split(p,t,",");for (i=1;i<=x;i++) if(t[i] ~ /-/) {split(t[i],t1,"-"); print "-dFirstPage=" t1[1] ,"-dLastPage="...
1,422
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]...
3,106
Posted By Corona688
$ cat fmrg.awk !F { F=FILENAME; FILENUM=1 } ...
$ cat fmrg.awk

!F { F=FILENAME; FILENUM=1 }
F != FILENAME { FILENUM++; F=FILENAME }

{
if((!MIN) ||(MIN>$1)) MIN=$1
if((!MAX) ||(MAX<$1)) MAX=$1
R[$1]++;...
2,814
Posted By jlliagre
The test is pointless, just remove it: ...
The test is pointless, just remove it:
'{nr[$1]=$2;f = $1} END{for (i=1;i<=f;i++) print i, nr[i] }'
3,495
Posted By Corona688
awk '{ for(N=1; N<=NF; N+=2) print $N, $(N+1); }'...
awk '{ for(N=1; N<=NF; N+=2) print $N, $(N+1); }' filename > outfile
6,812
Posted By Chubler_XL
Sorry, just caught me on a bad day I suppose. ...
Sorry, just caught me on a bad day I suppose.

I must admit I was very tempted to supply the following myself:
sed 's/[.,][^=.,]*$//' infile
6,812
Posted By rdcwayx
awk '{gsub(/[,.].*/, "",$2)}1' FS="=" OFS="="...
awk '{gsub(/[,.].*/, "",$2)}1' FS="=" OFS="=" infile
2,899
Posted By ahamed101
Try this... awk 'NR==FNR{a[$0]++;next}{for(i in...
Try this...
awk 'NR==FNR{a[$0]++;next}{for(i in a){gsub(i,"",$0);gsub("[,.] *$","")}}1' patternlist infile
--ahamed
27,387
Posted By Corona688
What other lines? I thought each file was one...
What other lines? I thought each file was one line...

If not, how about this?

awk -v ORS=" " 'LF != FILENAME { print FILENAME; LF=FILENAME }; {$1=$1} 1; END { printf("\n"); }' *.txt
27,387
Posted By Corona688
It would've been nice to know if those did what...
It would've been nice to know if those did what you wanted. If they don't, neither will the same thing written in awk! :wall:

ORS controls the output record separator, which is a newline by...
27,387
Posted By Corona688
You realize these are the UNIX forums, yes? ...
You realize these are the UNIX forums, yes? :wall:

Either way is a complete no-op. The only point of it is to inform awk that the data has changed, so that it should translate the newlines into...
7,122
Posted By radoulov
Try this: awk '/\xA0/ { print FILENAME, FNR...
Try this:

awk '/\xA0/ { print FILENAME, FNR }' *.txt
3,112
Posted By vgersh99
nawk '{ for(i=1;i<=NF;i++) if ($i ~...
nawk '{
for(i=1;i<=NF;i++)
if ($i ~ "^[2-3][.,][0-9][0-9]$" && $i>=2.30 && $i<=3.99)
print $i
}' myFile
5,555
Posted By bartus11
Try: awk 'NR==FNR{print;next}!/EL/' header.txt...
Try: awk 'NR==FNR{print;next}!/EL/' header.txt input.txt
3,116
Posted By ahamed101
if s is not empty then s=s FS $i if s is empty...
if s is not empty then s=s FS $i
if s is empty then s=x $i

if(s){
s=s FS $i
} else {
s=x $i
}


HTH
--ahamed
5,543
Posted By ahamed101
Try this... awk...
Try this...

awk '/^[0-9]/{match($0,"([0-9]*[; ]*[a-zA-Z].*)",a); $0=a[1]}1' input_file


--ahamed
5,543
Posted By ygemici
if you have gnu sed maybe u can try this $ sed...
if you have gnu sed maybe u can try this
$ sed '1~2s/.* \([^ ]* [^ ]* [^ ]* [^ ]*\)/\1/'
19,937
Posted By rdcwayx
awk -F, '{for (i=2;i<=NF;i++)...
awk -F, '{for (i=2;i<=NF;i++) a[$i]=a[$i]==""?$1:a[$i] FS $1}
END{for (i in a) if (i>0)print i FS a[i]|"sort -n"}' infile

1,A1,A3,A4
2,A1,A3
3,A3,A4
4 3,A1
4,A4
5,A1,A3,A4
6,A1...
19,937
Posted By rdcwayx
I guess the result need be sorted. awk -F ,...
I guess the result need be sorted.
awk -F , '{for (i=2;i<=NF;i++) if ($i>=0) print $1 FS $i|"sort -t, -k1,1 -k2,2n"}' infile

A1,1
A1,2
A1,4 3
A1,5
A1,6
A2,7
A2,8
A2,9
A2,10
A2,11
A2,12...
19,937
Posted By vgersh99
this is not really a matrix transposition - this...
this is not really a matrix transposition - this is a hybrid of some kind. And your desired output is not consistent - in particular the A3 and the A4 sequences...
A better/consistent example,...
3,452
Posted By yazu
Here is my code but it doesn't work. It's because...
Here is my code but it doesn't work. It's because of line ends. Somewhere you have dots, somewhere commas and in one line - 704/11 762,.

perl -F',\s+' -lane ' ...
Showing results 1 to 25 of 40

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