Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Max column count in AIX
Name: hisharme Date: November 3, 2007 at 02:27:35 Pacific OS: AIX CPU/Ram: 2GB
Comment:
Hi,
I need to find max column lenth of each column in a file. for eg. if file has col1 col2 col3 xyz abc mnopq ab pq xx
The output i need as col 1: 3, col2 :3 , col3 :4
please help, as in linux we can use wc -L but in UNIX AIX i couldn't find any command.
Name: fpmurphy Date: November 4, 2007 at 05:45:10 Pacific
Reply:
I am confused. In the GNU/Linux wc utility the -L (--max-line-length) argument prints the length of the longest line - not the length of the maximum column.
0
Response Number 2
Name: James Boothe Date: November 7, 2007 at 12:44:48 Pacific
Reply:
When the array entries are printed in the END statement, they often will not come out in numerical column order. But a little additional code can resolve that.
awk '{ for (i=1; i<=NF; i++) if ( length($i)>column[i] ) column[i]=length($i) } END { for (i in column) print i, column[i] }' infile
Summary: I have to send a file to mainframe and before sending it, I have to execute the quote command to set the record length. Since the file is dynamic, I do not know what the maximum size of a line could b...
Summary: Hello, does anyone know how I can display adpater config and change the IP address in AIX? I tried ifconfig and it doesn't seem to work... Louise ...