Originally Posted by Sha_unix
my doubt was not that, the above links what you have provided will not provide the answer. that is totally different. And i am asking the doubts after i am scratching my head for hours.. i know tat if ask all the things i wont learn anything.
Anyway thank for your advice. My doubt was hot to allign a data in a file. which looks like below.
"Gltbls_Data_02" 2097662 2.0004863739 1846783 1.7612295151 250879 .2392568588
"Gltbls_Index" 262158 .2500133514 229727 .2190847397 32431 .0309286118
"ProcDetl_Data" 511 .0004873276 511 .0004873276 0 0
The word "doubt" and the word "question" are two different things, and please spell out your words. And the previous two questions you asked ARE the same things...you asked how to add a heading, and how to align columns. Which is EXACTLY what you're asking here. Again, you use awk with formatted printing, and were told how to use either sed or cat commands to insert a header, in your other thread:
Very first hit in Google, after typing in "awk formatted output":
Now, let's examine what you've been told:
- You know how to insert a header into a file via various methods (cat, sed, etc.)
- You know how to use awk to format output
So...use formatted awk output and either pipe it into sed or use the ">>" to get the header into a file (see replies in your other thread), then use the same formatted awk output command to get the rest of your data into the file. Again, read the pages on how to use awk to output formatted text, as you've been directed to. If you are ALREADY
getting formatted output, but it's not lining up the way you want it to...CHANGE IT
If the input text is already formatted (but incorrectly), you'll have to fix it first, which brings us back to the formatted awk output. Pumping B.txt through awk will re-format it the way you want. Which takes us back to your previous thread, which will tell you how to put the header onto that formatted file.