Shell or PERL Logic


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell or PERL Logic
# 1  
Old 06-03-2008
Shell or PERL Logic

Hello All,

Currently i am working on a logic in PERL scripting ...

But i am sort of stuck up, can any one please help.

Here goes.

1. Search for a pattern in a file
2. If the pattern matched lets say 10 lines
2.1 Reterive the first line and check for another pattern
2.1.1 if the second pattern found
2.1.1.1 extract the characters between the patterns
2.1.1.2 if its numbers, replace it with another set of numbers provided as input.
2.2 Reterive the Second line and check for another pattern
2.2.1 if the second pattern found
2.2.1.1 extract the characters between the patterns
2.2.1.2 if its numbers, replace it with another set of numbers provided as input.
......................
2.10 Reterive the Second line and check for another pattern
2.10.1 if the second pattern found
2.10.1.1 extract the characters between the patterns
2.2.10.2 if its numbers, replace it with another set of numbers provided as input.




The Problem is i am not that much familiar with the PERL commands,i am trying to work on any help would be grateful.

Thanks

Rahul
# 2  
Old 06-04-2008
No offense, but here we don't write scripts, we just help, what have you done so far ? You're saying : I'm not familiar with perl - why don't you write the script in a suitable for you language ? BTW, with a little bit of googling for each of the blocks for this, supposedly, homework, you can achieve a lot, but learning perl via online forum is tough job.
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script logic

Hi I have a requirement where I have to generate a mail/alert to the user if any QA check is failed. our oracle jobs run in unix environment and log file is created . Sample is given below . SELECT * FROM product.fact_tally WHERE period_id = '20130401' ; LIMIT 5; Ideally the above... (4 Replies)
Discussion started by: systemee
4 Replies

2. Shell Programming and Scripting

Perl scripts: requesting for logic explanation

Hi, balajesuri and durden_tyler, I have found your perl script for the thread https://www.unix.com/shell-programming-scripting/176370-perl-script-help-me-extracting-string.html, but find it difficult to understand the syntax. Could you or any forum members kindly shed some light on the logic... (3 Replies)
Discussion started by: royalibrahim
3 Replies

3. Shell Programming and Scripting

Shell/Perl logic for loop

Hi, I have a requirement as follows. Have 3 files. Need to match up the data in each one of them and sum up the data by a field and display it. example given below. File 1 : Name, Emp id File 2 : Empid, Subject, File 3 : Subject, Score, Class Match Emp id in File 1 and File 2 and then... (7 Replies)
Discussion started by: preethgideon
7 Replies

4. Shell Programming and Scripting

Need logic for shell scripting

I am comfortable with shell scripting. I need a better logic for below, I've a reference file, to take the parameter value. For example in the no of channel is 6 i have get the commands as written below. I need need a differenct logic to extract the commands. NO_OF_CHANNEL=6 case... (3 Replies)
Discussion started by: ilugopal
3 Replies

5. Shell Programming and Scripting

perl script - adding restart logic

Hi all I have written a perl script which looks at one file and if new entry is made to that file then it runs some scripts depending upon the entry made to file( used File::Tail module ) . This script is running as “root” in nohup mode. Script works fine but I want to add restart logic. If... (4 Replies)
Discussion started by: zedex
4 Replies
Login or Register to Ask a Question