![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 | Thread Starter | Forum | Replies | Last Post |
| Perl Scripting | agarwal | Shell Programming and Scripting | 3 | 04-30-2008 09:12 AM |
| Perl Scripting.. | Kingkon | Shell Programming and Scripting | 4 | 03-06-2008 07:31 PM |
| Perl scripting | rsendhilmani | Shell Programming and Scripting | 3 | 07-04-2007 11:51 PM |
| Perl Scripting | vaibhav | Shell Programming and Scripting | 10 | 03-27-2007 02:32 AM |
| Perl scripting | rochitsharma | UNIX for Advanced & Expert Users | 2 | 08-24-2006 04:55 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Perl scripting
Can anyone help .....
I am prettey new to perl but would like to do the following :- write a script that would open one or more log files and select a few lines from each and create a new file with the selected lines from the logs. Thanx |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
edited post
[Snipped by LivinFree]
Crawler - that was innapropriate. It was counter-productive and a waste of time. "A little knowledge is a scary thing"
__________________
.....::: the crawler:::..... Last edited by LivinFree; 05-10-2002 at 09:45 PM. |
|
#3
|
|||
|
|||
|
Okay, what have you got so far? Let's see some code?
Being new to Perl does not get free scripts for you. People know how to do that because they learned Perl. Here's a hint though: Code:
prompt$ perldoc -f open Code:
prompt$ perldoc FileHandle
__________________
- dsb - Perl Guy |
|
#4
|
|||
|
|||
|
Re: kiddie...
Quote:
|
|
#5
|
|||
|
|||
|
Basically you will need to load the log file entirely into an array, or line by line because you are looking to separate items. The file system of perl in not very efficient, but nonetheless, what you ask for is VERY easy, VERY common and VERY obvious in the books, texts and examples. If you get stuck, let me know, happy to TEACH but not DO IT FOR YOU......
Depending on your OS, you may NOT be able to follow some of the former advice, or, it may be to your advantage, again, this depends on your os, not perl..... i.e. OSX, AIX, UNIX5,WIN2K,Linux,DOS, and also how your server is set up, is this under an Apache or IIS server or all by it's lonesome... Nytok
__________________
Nytok Arrow Mountain International Software Development |
|||
| Google The UNIX and Linux Forums |