![]() |
|
|
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 |
| Convert a tab delimited/variable length file to fixed length file | Everton_Silveir | UNIX for Dummies Questions & Answers | 2 | 12-19-2008 06:21 PM |
| 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 |
| Fixed Length records- Korne Shell Program. | nrajesh_2009 | Shell Programming and Scripting | 4 | 04-11-2007 12:41 PM |
| fixed record length | george_ | Shell Programming and Scripting | 16 | 03-28-2006 06:41 AM |
| creating a fixed length output from a variable length input | r1500 | Shell Programming and Scripting | 2 | 12-03-2003 01:09 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
awk to extract incorrect fixed length records
I have a number of unix text files containing fixed-length records (normal unix linefeed terminator) where I need to find odd records which are an incorrect length.
The data is not validated and records can contain odd backslash characters and control characters which makes them awkward to process in shell. Files are unlikely to exceed 1000 records, so efficiency is not important. Each file has a different fixed length record size. I am looking for an awk program which can read the length of the first record of a file, then output only those records which are of a different length to the first record. The program does not need to cater for the first record being wrong. This post works beautifully, but you need to know the length of the record in advance. Check length of record |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|