|
google site
|
|||||||
| Forums | Register | Blog | Man Pages | Forum Rules | Links | Albums | FAQ | Users | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Search flat file in specific byte
I am on AIX Unix. I want to read a flat file for a string in a certain byte. I want to find the value: 943034 in column 56; and write out just those records to another file. Also, could I get the line/record number of where it was found in the input file?
Thank you, sboxtops |
| Sponsored Links | ||
|
|
|
#2
|
|||
|
|||
|
Code:
awk ' substr($0,56,6)=="943034" {print FNR ":", $0} ' inputfile |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need specific byte positions of a file | rmv | Shell Programming and Scripting | 6 | 10-13-2009 06:31 AM |
| `find`, pulling 1st field from ASCII flat file as search/-name? | Gecko12332 | Shell Programming and Scripting | 2 | 10-06-2009 04:34 PM |
| Read Write byte range/chunk of data from specific location in file | Kbenipel | Shell Programming and Scripting | 1 | 05-22-2009 04:56 PM |
| Search flat file and return 3 fields | da2357 | Shell Programming and Scripting | 7 | 11-18-2008 10:01 PM |
| remove specific lines from flat file using perl | meghana | Shell Programming and Scripting | 12 | 02-12-2008 08:50 PM |