Hi,
How to format something like this:
HTML Code:
John Roberts 324-141-984 Acct
Jack Williams 159-555-555 Acct
William Jackson 949-911-888 Acct
Mark J Walton 145-852-252 Acct
Fred P Milton 483-244-390 Acct
Bill P J Miller 404-050-223 Acct
into this: Using AWK (Equal distance between columns)
HTML Code:
John Roberts 324-141-984 Acct
Jack Williams 159-555-555 Acct
William Jackson 949-911-888 Acct
Mark J Walton 145-852-252 Acct
Fred P Milton 483-244-390 Acct
Bill P J Miller 404-050-223 Acct
As you can see the names are 2,3,4 fields long.
Here is my code but it is not working because the Names column is messing the other columns:
HTML Code:
if (NF >= 6) {
printf ("\n%s %s %s %-10s %s\t\t %s", $1, $2, $3, $4, $5, $6)
}
else
if (NF == 5) {
printf ("\n%s %s %-25s %-15s\t %s", $1, $2, $3, $4, $5)
}
else {
printf ("\n%s %s\t\t\t %s\t\t %s\t", $1, $2, $3, $4)
}
}
END { printf("\n")}
Please assist ... Thanks in advance