![]() |
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 |
| cut - columns with formatted Output | dhanamurthy | Shell Programming and Scripting | 9 | 05-19-2008 10:20 AM |
| Formatted Output | dhanamurthy | Shell Programming and Scripting | 6 | 05-13-2008 02:30 AM |
| formatted output with commas | joeyg | Shell Programming and Scripting | 4 | 03-04-2008 03:54 PM |
| Formatted output in KSH | psynaps3 | Shell Programming and Scripting | 1 | 07-05-2006 08:03 AM |
| Validating a formatted message | BrianOsburn | Shell Programming and Scripting | 10 | 08-12-2003 05:13 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Formatted output - awk
Hi
I have the following records in a file SABN YOURTUBE 000514 7256 SACN XYOUDSDF 000514 7356 SADN KEHLHRSER 000514 7656 SAEN YOURTUBE 000514 7156 SAFN YOURTUBE 000514 7056 I need to put this in the format like this printf '%s %-50s %6s %-6s\n' I am not going to read individual lines and do a printf as the processing time taken is in hours which is not expected. I would like to cut the entire column 1,2,3,4 and output in the printf format given above. Any examples would be appreciated. Regards Dhana |
|
||||
|
Quote:
awk has printf built-in, so I don't understand what exactly you need help with. |
|
||||
|
Formatted Output - Awk
Hi
I have been reading individual lines of the file using sed and cutting the columns that i need and using printf '%s %-50s %6s %-6s %s\n' I was able to achieve my things. But i am reading a 1 GB file and the processing of these steps was more and going for hours as i am reading each line. So.. i thought of removing the whole individual columns itself and print the column output in the above printf format. As this will not read each line and processing would be fast. Let me know if you need more information. Regards Dhana |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|