![]() |
|
|
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 |
| How to merge rows into columns ???? | bogu0001 | Shell Programming and Scripting | 4 | 01-16-2009 07:57 PM |
| how to convert columns to rows | suresh3566 | Shell Programming and Scripting | 6 | 11-04-2008 08:20 AM |
| awk - reformating rows into columns | jmd2004 | Shell Programming and Scripting | 1 | 08-14-2008 12:56 AM |
| Columns to rows | mgirinath | Shell Programming and Scripting | 16 | 11-29-2007 07:03 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Hi.
There may be a better way, but... Code:
awk 'NF > X { X = NF } END {print X, NR}' my_file
where X is the number of columns and NR is the number of records. use awk -F to specify a delimeter if it's not a (white)space. |
|
||||
|
Quote:
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|