|
|
|
|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | 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. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||
|
print a file with one column having fixed character length
Hi guys,
I have tried to find a solution for this problem but couln't. If anyone of you have an Idea do help me. INPUT_FILE with three columns shown to be separated by - sign A5BNK723NVI - 1 - 294 A7QZM0VIT - 251 - 537 A7NU3411V - 245 - 527 I want an output file in which First column should have only fixed no. of characters say 7 or whatever no. I need and rest of the columns should be the same. OUTPUT_FILE A5BNK72 - 1 - 294 A7QZM0V - 251 - 537 A7NU341 - 245 - 527 Your help is highly appreciated. ![]() |
| Sponsored Links | ||
|
|
|
|||
|
With sed: Code:
sed 's/\(.......\).*\( -.*-.*\)/\1\2/' file |
| Sponsored Links |
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Changing one column of delimited file column to fixed width column | manneni prakash | Shell Programming and Scripting | 5 | 06-22-2009 06:27 AM |
| What the command to find out the record length of a fixed length file? | tranq01 | UNIX for Dummies Questions & Answers | 9 | 12-04-2008 04:04 PM |
| convert fixed length file to CSV | tbtbs | Shell Programming and Scripting | 12 | 08-12-2008 10:54 AM |
| Comparing column of variable length anf fixed width file | manneni prakash | Shell Programming and Scripting | 5 | 06-25-2008 02:46 AM |
| use SQL loader to dump a fixed length file in to DB | anumkoshy | Shell Programming and Scripting | 2 | 10-10-2007 06:53 AM |