![]() |
|
|
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 |
| What the command to find out the record length of a fixed length file? | tranq01 | UNIX for Dummies Questions & Answers | 9 | 12-04-2008 04:04 PM |
| AWK record length fix | kanu_pathak | Shell Programming and Scripting | 4 | 10-08-2008 04:28 PM |
| fl command - set record length | Tom Siegel | Shell Programming and Scripting | 2 | 07-17-2006 10:50 AM |
| fixed record length | george_ | Shell Programming and Scripting | 16 | 03-28-2006 06:41 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
awk to find the length of each record.
Hi Guys, I wanted to print the length of each record and the record itself. I tried the following awk ... Code:
awk 'a=length(); {print $a,$0}' file1
But it is giving me the records instead of length. and also, it giving me each record twice. Means the value of a is not the length of the record but the record itself.. could you please point out my mistake.. thanks Magesh ---------- Post updated at 06:52 PM ---------- Previous update was at 06:46 PM ---------- Guys, i found the answer.. Code:
awk '{print length($0),$0}' file1
|
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|