![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| To convert multi format file to a readable ascii format | gaur.deepti | UNIX for Dummies Questions & Answers | 5 | 03-25-2008 03:03 PM |
| change the format of a giving file ( a bit challenge) Thank you | netbanker | Shell Programming and Scripting | 5 | 12-04-2007 02:49 PM |
| Giving input to a c++ file | tonyaim83 | Shell Programming and Scripting | 2 | 10-23-2007 02:10 AM |
| Convert UTF8 Format file to ANSI format | rajreddy | UNIX for Dummies Questions & Answers | 9 | 05-25-2007 09:26 AM |
| Convert UTF8 Format file to ANSI format | rajreddy | UNIX for Advanced & Expert Users | 1 | 05-24-2007 07:40 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Giving format to a file
hi all,
i have a big problem and i don't know what to do. This is the thing: i have a flat file with 26 fields, which are separated by ';' by example, i have this: Peter;Smith;2005;200508; ......... if the lengths of the fields are: field 1: Alphanumeric[10] - field 2: Alphanumeric[10] - field 3: numeric[8] - field 4: numeric [10] - etc .... i want this: Peter ;Smith ;00002005;0000200508; I need giving format to each field, to get the length of each field, which is established. if the field is numeric, i must fill with zeroes to the left of the number, until the length of the field is completed. if the field is alphanumeric, i must field whit blank spaces to the rigth of the value. an important thing, is what i must keep the field separator ( .how can i do that¿? please, help me thanks for your help |
|
||||
|
At last I found the answer to my question.
{The change is in bold} Code: Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|