Superb.......jus one more help...... i jus want them to be formatted so it looks neat......as table name and numbers are of different length so all is getting jumbled...!
Hope will not have to bug you all after this....
Even if will have to, will come back and ask...
I already thought so about the formatting
I wouldn't take care of the format before being sure having the right data.
I can't answer immediately (i'm a bit overbooked) but i'm sure i'll find a nice solution. Just say me the width and alignment you want for each column.
What's this table for, a process or a human? If you want it to be machine processable, consistent formatting is much more important than pretty formatting.
Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Hi.
The best automatic column alignment tool I have seen is align. It can found at align | freshmeat.net
An example of the use can be seen at the end of this script, using the frans split and paste method for this dataset:
Producing:
As you can see it recognizes fields as alphabetic or numeric, and, with the separator option, will split fields by TABs. I adjusted the settings of paste to correspond to the output that the OP last displayed.
Adding column headings, if desired, is left as an exercise.
Best wishes ... cheers, drl
Note 1: the visual alignment of the output looks off in the second-last line compared to my terminal. The default join scheme is a combination of TAB and SPACE characters, so it looks to me as if the forum CODE block SPACE characters are somehow different in size from my terminal. I looked at the raw output and there are TABs between the alpha field and the first numeric column, but SPACES (as they should be) between the numeric columns. I'll continue to look at it, but it appears OK on my display. This is the first that I have noticed such an anomaly.
Note 2: The second last line does not include a TAB, only SPACES after the label, so I think that that is the source on the visual issue.
Note 3: Shortening the label in question produces:
for which align then adds a TAB in that line, and columns appear aligned here. In both cases the output is visually aligned at my work display. This leads me to believe that SPACEs have a different value in CODE blocks compared to my workstation environment. I haven't used anything else other than Debian to look at this thread, so I suppose it is possible that the software chain is distorting the image for me, and that it appears OK to others. Perhaps I'll try looking at it with a Mac and a browser different from Firefox ( or Iceweasel, as it is known in Debian-land )
Note 4: From Mac OS X, Safari, both displays look fine, so the problem is on my end, somewhere in the browser or X. I may look at it more, but the issue is not critical for me.
Note 5: Back on Linux, browser Galeon. Both displays are way off.
Note 6: Linux, epiphany-browser. First display off, second OK. Seems to point to X and / or fonts.
Hello Team,
I have the following details in a txt file (please note the spaces and tabs)
C1 C2 C3
------------------ --------------- -------------
abc, xyz 2 8
pqr 2 ... (9 Replies)
I have written some scripts that resulted in the table below (Column1 is ITEM, Column2 is Group, Column3 is Category and Column4 is Quantity) but I want the output in another format:
Input:
K123 X CATA 3
K123 Y CATA 4
K123 Z CATA 2
K123 X CATB 5
K123 Y CATB 2
K123 Z CATB 2
B65 M CATB... (7 Replies)
Hi ,
i am generating some data by firing sql query with connecting to the database by my solaris box.
The below one should be the header line of my excel ,here its coming in separate row.
TO_CHAR(C. CURR_EMP_NO
---------- ---------------
LST_NM... (6 Replies)
Hello Learned People,
Good evening. I have absolutely no idea as how to do this & I admit that I do not know anything in unix. I must learn this one of these days.
Im a help desk incharge today & someone gave me this file to be formatted & I have a file like this.
vi NewFile.txt
232... (8 Replies)
Hi,
I have two files , one file with data file with attributes that need to be sent to another file to generate a predefined format.
Example:
File.txt
AP|{SSHA}VEEg42CNCghUnGhCVg==
APVG3|{SSHA}XK|"password"
AP3|{SSHA}XK|"This is test"
....
etc
---------
test.sh has... (1 Reply)
i am running df -k command on aix machine.
i got the output like this. i need to store into file and send that file into microsoft excel.i need to allign properly.
Filesystem 512 blocks Free % Used Iused %Iused Mounted on
/dev/hd4 262144 126488 52% ... (9 Replies)
Hi all,
I have input text file of this format
objectclass:endeavor
pid:12345
postalAddress:379 PROSPECT ST
street:STE B
l:TORRINGTON
st:CT
postalCode:067905238
telephoneNumber:9999999999... (2 Replies)
Dear all,
I have written a program which access database and displays the values returned by the query . There are 10 columns to be displayed in one row. But am ending with 5 lines displayed on 1st line and the next 5 in the 2nd line.
Ex :
21608 10-20-2007 148 Al's Appliance... (7 Replies)
Hi all, I'd like to capture the output from the 'top' command to monitor my CPU and Mem utilisation.Currently my command isecho date
`top -b -n1 | grep -e Cpu -e Mem` I get the output in 3 separate lines.Tue Feb 24 15:00:03
Cpu(s): 3.4% us, 8.5% sy .. ..
Mem: 1011480k total, 226928k used, ....... (4 Replies)
below is the output is ls -l
-rw-r--r-- 1 tonyt staff 3212 Apr 17 1999 file1
-rw-r--r-- 1 tonyt staff 4541 Mar 3 21:08 file2
why the date format is not the same? (6 Replies)