![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Perl Scripting | agarwal | Shell Programming and Scripting | 3 | 04-30-2008 01:12 PM |
| Perl Scripting.. | Kingkon | Shell Programming and Scripting | 4 | 03-06-2008 10:31 PM |
| Perl scripting | rsendhilmani | Shell Programming and Scripting | 3 | 07-05-2007 03:51 AM |
| Perl Scripting | vaibhav | Shell Programming and Scripting | 10 | 03-27-2007 06:32 AM |
| Perl scripting | rochitsharma | UNIX for Advanced & Expert Users | 2 | 08-24-2006 08:55 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
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" Last edited by LivinFree; 05-11-2002 at 01:45 AM.. |
|
||||
|
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 |
|
||||
|
Re: kiddie...
Quote:
just kidding! no offence, i just like to deflate bubles. you don't have to do the script for him, just give examples! think of it as a compliment that he seeks out your vast wisdom! |
|
||||
|
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 |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|