![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| Comparing column of variable length anf fixed width file | manneni prakash | Shell Programming and Scripting | 5 | 06-25-2008 01:46 AM |
| Replacing column with column of another file | manneni prakash | UNIX for Advanced & Expert Users | 1 | 06-24-2008 11:27 PM |
| Replacing column with column of another file | manneni prakash | UNIX for Dummies Questions & Answers | 1 | 06-24-2008 11:20 PM |
| How to check Null values in a file column by column if columns are Not NULLs | Mandab | Shell Programming and Scripting | 7 | 03-15-2008 09:57 AM |
| Replace 10th column with a new column--- Terriblly hurry | ahmedwaseem2000 | Shell Programming and Scripting | 2 | 09-06-2005 01:10 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Changing one column of delimited file column to fixed width column
Hi, Iam new to unix. I have one input file .
Input file : ID1~Name1~Place1 ID2~Name2~Place2 ID3~Name3~Place3 I need output such that only first column should change to fixed width column of 15 characters of length. Output File: ID1<<12 spaces>>Name1~Place1 ID2<<12 spaces>>Name2~Place2 ID3<<12 spaces>>Name3~Place3 Thanks in advance. Last edited by manneni prakash; 07-01-2008 at 02:33 AM.. |
|
||||
|
Code:
nawk -F"~" '{printf("%-15s%s~%s\n",$1,$2,$3)}' yourfile
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|