![]() |
|
|
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 |
| Search Replace with regular expressions | dirdamalah | Shell Programming and Scripting | 1 | 06-21-2008 07:53 AM |
| Regular Expressions HELP - PERL | maxmave | Shell Programming and Scripting | 3 | 06-05-2008 04:45 AM |
| Regular Expressions HELP - PERL | maxmave | UNIX for Dummies Questions & Answers | 1 | 06-04-2008 01:15 PM |
| regular expressions | ragha81 | UNIX for Dummies Questions & Answers | 2 | 03-05-2007 07:24 PM |
| Perl regular expressions... | DrRo183 | Shell Programming and Scripting | 1 | 04-26-2006 10:28 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
perl regular expressions and field search
Hello guys/gals,
i am sorry as this is probably very simply but i am slowly learning perl and need to convert some old korn shell scripts. I need to be able to search a file line by line but only match a string at particular location on that line, for example character 20-30. So my file could look something like this: Code:
apple orange apple
apple potato apple
tomato flower orange
Thanks a bunch |
|
||||
|
If you want to SPLIT a line into FIELDS as you say you do in bash, then look up perl's split() built in subroutine... On the other hand, if what you really want is to test the characters from positionX to positionY, then use perl's unpack() function. Once you split out your field by delimiter or position, then you can test it using regular expressions to see if it is the string you want...
I'm not going to do ALL the work for you ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|