I've tried to play around with the given solution, but with limited knowledge in this area, I'm unable to solve it.
That's why I need help from more experience users.
Thanks.
Regards,
Peter
---------- Post updated at 04:48 AM ---------- Previous update was at 04:46 AM ----------
Hi ygemici,
The result is still the same for more entries, however, I had been given other solution that works.
Thanks for your help.
Regards,
Peter
---------- Post updated at 05:09 AM ---------- Previous update was at 04:48 AM ----------
Hi zaxxon,
I found your method is quite interesting and have been trying to understand what does it mean and how it works.
Could you advice what does this section mean?
When I tried your method with more entries, the alignment is out. But, this does not happen with fewer entries. The first column is OK, not the second and third. Could not understand why.
Sure. Since your input file has no real usable field separator, I decided to use the B of GB (that's the awk -F "B") as field separator.
Between the fields is sometimes 1 blank and sometimes many more than 1 blank separating them. So I tell awk to globallysubstitute, every 2 or more blanks with a single blank. If not doing that, it happens that the sometimes plentyful blanks in your lines just push the fields further apart so that a formatting with printf is kinda ugly and not possible.
So if you check what happens when you just use the code above without the long printf, you get this:
This a much more tidy base to start from, using "B" as field seprator. All those different amounts of spaces pushing fields apart are gone and sowith do not disturb using printf.
Last edited by zaxxon; 06-23-2010 at 12:30 PM..
Reason: adding info
Hi,
I am trying to use printf command and format certain output in a specific format as under:
While the left side (upto |) of the above format is part of a fixed header function, the right side is where i am expecting data to be printed. However, as seen, Row1 value is reflecting on last... (5 Replies)
Hi all,
Can anyone please suggest how best to handle output from running df where some of the information for a volume/filesystem spread over two lines?
Some of my volume/filesytem are NFS mounted and when I run a df, the information is spread over the two lines instead of the usual norm... (4 Replies)
Hi
How can I alaign the output of a script.
Exaplme
my script has assigned values to two variables, VAR1 and VAR2
VAR1=This is RAJ working as a DB2 UDB DBA for VISA Corporation, Need your help in Shell scripting
VAR2= This is RAM working as a ORACLE DEVELOPER for TARGET... (1 Reply)
Hi Experts,
I have to create a report for certain audit and my output looks as follows
I m trying to format my output to look like
Any inputs would be highly appreciated
Thanks
Syed (5 Replies)
Hi Gurus,
This is my raw data. How would I able to format this output into a better alignment?
/dev/vg00/lvol5 /home 0.12 GB 0.02 GB 0.10 GB 19%
/dev/vg00/misc /misc 28.43 GB 4.92 GB 23.51 GB 17%
/dev/vg00/lvol6 /opt 8.25 GB 5.43 GB 2.82 GB 65%
/dev/vgsap/ora10264 ... (10 Replies)
Is it possible to convert the attached file to the format mentioned.
Here for a particular job the table name and the corresponding instance name from one test run "X" is compared with the table name and the instance name from the second test run "Y" for output rows,affected rows,applied... (1 Reply)
Hi
I'm trying to display the output of my script in a friendly viewable format.
it's something like this..
i have this while loop... in which i get some records from a file where fields are delimitered with a pipe. so i'm extacting each field and replacing the pipe with a \t, tab !!..
cat... (7 Replies)