Search Results

Search: Posts Made By: bronofski
1,917
Posted By Don Cragun
OK. If you've pre-verified the input file, you...
OK. If you've pre-verified the input file, you can strip my suggestion down to:
#!/bin/ksh
awk '/[^[:digit:]]/ { h[++hc] = $0; next}
{ o[hc,++oc[hc]] = $0}
END { printf("%-3s%s\n", h[1],...
1,917
Posted By pamu
awk '/[a-zA-Z]/{i=0} ...
awk '/[a-zA-Z]/{i=0}
{i++;A[i]=A[i]?A[i]"\t"$0:$0}
END{for(j=1;j<=i;j++){print A[j]}}' file
1,917
Posted By Scrutinizer
awk '/[^0-9]/{f=NR} f>1{print A[NR-f+1],$0; next}...
awk '/[^0-9]/{f=NR} f>1{print A[NR-f+1],$0; next} {A[NR]=$0}' file
Showing results 1 to 3 of 3

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