hi,
the input file has n columns delimeted with "|" like on example below.
how to find max lenght for each column and use it later for printf formatting the input file?
awk '{ printf "%-[highlight #EF2929]max1[/highlight]s %-[highlight #EF2929]max2[/highlight]s %-[highlight #EF2929]max3[/highlight]s %-s\n", $1, $2, $3, $4 }' ....
for testing
# echo -e "121|234234|5345|2342342342432423\n1|2342|2|2342\n234|23|343|34214222"
121|234234|5345|2342342342432423
1|2342|2|2342
234|23|343|34214222
thank you in advance
the input file has n columns delimeted with "|" like on example below.
how to find max lenght for each column and use it later for printf formatting the input file?
awk '{ printf "%-[highlight #EF2929]max1[/highlight]s %-[highlight #EF2929]max2[/highlight]s %-[highlight #EF2929]max3[/highlight]s %-s\n", $1, $2, $3, $4 }' ....
for testing
# echo -e "121|234234|5345|2342342342432423\n1|2342|2|2342\n234|23|343|34214222"
121|234234|5345|2342342342432423
1|2342|2|2342
234|23|343|34214222
thank you in advance