Search Results

Search: Posts Made By: suturjik
1,635
Posted By RudiC
Try alsoawk 'NR==1 {MX=NF; for...
Try alsoawk 'NR==1 {MX=NF; for (i=NF;i>=1;i--) {if ($i=="period") break; T[i]=$i};i+=1;next}
{for (j=i; j<=NF; j++) print $1, $2, $3, $4, $5"_"T[j], $(6-i+j), _}
'...
1,635
Posted By pilnet101
Sorry I get you now: awk 'NR==1 { for...
Sorry I get you now:

awk 'NR==1 {
for (i=6;i<=NF;i++) {
h[i]=$i
}
next
}
{for (x=6;x<=NF;x++) {
print $1 OFS $2 OFS $3 OFS $4 OFS $5"_"h[x] OFS $x OFS
}
}' FS=\; OFS=\| ...
1,635
Posted By pilnet101
You can try this: awk 'NR==1 {next} {for...
You can try this:

awk 'NR==1 {next}
{for (x=6;x<=NF;x++) {
print $1 OFS $2 OFS $3 OFS $4 OFS $5"_"substr($x,1,match($x,/[0-9]/)-1) OFS $x OFS
}
}' FS=\; OFS=\| in.csv > out.txt
Showing results 1 to 3 of 3

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