Search Results

Search: Posts Made By: andy2000
6,525
Posted By durden_tyler
The Perl script will not work either because the...
The Perl script will not work either because the numeric part of the header columns moved to the left of the underscore ("_") instead of the right.

So, the index to compare after the "split"...
6,525
Posted By Corona688
[edit] I misunderstood the problem. You need the...
[edit] I misunderstood the problem. You need the line sorted.

When you say "only first line", what do you mean? Clearly the second line is changed too.
6,525
Posted By RudiC
Try also read LINE < file echo $LINE | tr...
Try also
read LINE < file
echo $LINE | tr '_;' ' '$'\n' | sort -k2n | tr ' ' '_' | awk -F";" '
FNR == NR {T[$0] = NR
MX = NR
next
}
FNR...
6,525
Posted By Corona688
In that case: awk ' function rbefore(STR) ...
In that case:

awk '
function rbefore(STR) { return(substr(STR, 0, RSTART-1)); }# before match
function rall(STR) { return(substr(STR, RSTART, RLENGTH)); }# Entire match
function...
6,525
Posted By RudiC
I guess s/he wants the first line sorted, and the...
I guess s/he wants the first line sorted, and the columns of the residual lines rearranged to stay with their header.
6,525
Posted By rdrtx1
gnu awk? awk ' { for (i in a) delete...
gnu awk?
awk '
{
for (i in a) delete a[i];
for (i in b) delete b[i];
for (i=1; i<=NF; i++) {
v=$i; sub("^[^0-9]*", "", v);
v=sprintf("%020d", v);
a[v]=v; b[v]=$i;
...
1,741
Posted By bartus11
I made assumption that you want longest value in...
I made assumption that you want longest value in field #4 and that you want to add numbers in fields #5, #6, #7:
awk -F\;...
Showing results 1 to 7 of 7

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