![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| combining fields in two text fields | shocker | Shell Programming and Scripting | 3 | 01-16-2008 07:27 AM |
| cut: get either one or two fields | maxvirrozeito | Shell Programming and Scripting | 3 | 12-17-2007 07:58 AM |
| Last fields | Khoomfire | UNIX for Advanced & Expert Users | 3 | 04-13-2006 02:03 PM |
| how to cut fields | rajan_ka1 | Shell Programming and Scripting | 1 | 12-29-2005 01:55 AM |
| Awk - more than 99 fields? | DaveM | UNIX for Dummies Questions & Answers | 2 | 01-23-2001 09:34 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
justifying the fields
hi experts,
i just need a help that my script is generating the output which i will mentioned below but the fileds are not justified the alignment is disturbed. 0 8718 8718 0 8777 1 7450 7450 0 7483 2 5063 5063 0 5091 3 3840 3840 0 3855 4 3129 3129 0 3142 5 2400 2400 0 2419 6 2597 2597 0 2604 7 3055 3055 0 3078 8 4249 4249 0 4266 9 4927 4927 0 4957 10 8920 8920 0 8978 11 19567 19567 0 19675 12 15249 15249 0 15330 13 13930 13930 0 14015 14 13694 13694 0 13742 15 13066 13066 0 13122 16 12477 12477 0 12548 17 12791 12791 0 12855 18 13754 13754 0 13842 19 13181 13181 0 13259 20 12991 12991 0 13048 21 12435 12435 0 12484 22 13545 13545 0 13624 23 14584 14584 0 14656 total 235612 235612 0 236850 so at the end i just want the output in the correct format and justified like. 0 8718 8718 0 8777 1 7450 7450 0 7483 2 5063 5063 0 5091 3 3840 3840 0 3855 4 3129 3129 0 3142 5 2400 2400 0 2419 6 2597 2597 0 2604 7 3055 3055 0 3078 8 4249 4249 0 4266 9 4927 4927 0 4957 10 8920 8920 0 8978 11 19567 19567 0 19675 12 15249 15249 0 15330 13 13930 13930 0 14015 14 13694 13694 0 13742 15 13066 13066 0 13122 16 12477 12477 0 12548 17 12791 12791 0 12855 18 13754 13754 0 13842 19 13181 13181 0 13259 20 12991 12991 0 13048 21 12435 12435 0 12484 22 13545 13545 0 13624 23 14584 14584 0 14656 total 235612 235612 0 236850 so please kindly tell me that how i can justfied te filelds properly though shell script. |
| Forum Sponsor | ||
|
|
|
|||
|
i dont see the justications in ur message..
does this help? awk '{printf ("%8s%8s%8s%8s%8s\n",$1,$2,$3,$4,$5);}' sample Quote:
|