![]() |
|
|
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 |
| Grepping the last 30 minutes of a log file... | jtelep | Shell Programming and Scripting | 2 | 03-06-2008 12:27 AM |
| Help needed in removing intermediate segments from a pipe delimited segment file | naren_0101bits | Shell Programming and Scripting | 3 | 12-03-2007 11:54 AM |
| Grepping Errors in a file | achararun | Shell Programming and Scripting | 4 | 02-05-2007 03:36 AM |
| grepping a part of filenames | jazz | Shell Programming and Scripting | 11 | 10-18-2006 09:03 PM |
| grepping the first 3 characters from a file | g-e-n-o | UNIX for Dummies Questions & Answers | 2 | 10-15-2001 07:11 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
I am trying to grep for filenames containing a specific value within a particular segment. The lines containing the segment I'm looking through reads like "HL^1^^1^1", "10^9^9^0", and "HL^11^4^8^1". I would like to find the data that contains only the number nine after the third caret where the line begins with the phrase "HL". I've tried ranges with Code:
grep -l ^HL\^[range]\^[range]\^9 , etc. but not every filename that should be returned are being reported. The values following the first and caret do not have a fixed range, nor is there a set number of how many characters will be contained there. Please help. Thanks! |
|
||||
|
I would like to put together something that will use the mentioned criteria, and have a specific prefix be appended to the beginning of the filename if it contains the particular string of text I am looking for. I've several approaches in mind, but they are all manual, and I would like to get to the point where I can script this. Would someone be able to point me in the right direction to accomplish this please? Thanks.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|