![]() |
|
|
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 |
| perl parse line | netxus | Shell Programming and Scripting | 2 | 08-24-2009 01:45 PM |
| Perl Parse Word Cksum help | TeamUSA | Shell Programming and Scripting | 1 | 07-07-2009 05:47 AM |
| Perl parse string to time | King Nothing | Shell Programming and Scripting | 1 | 05-19-2009 11:10 PM |
| CSV File parse help in Perl | lodey | Shell Programming and Scripting | 13 | 03-31-2008 10:06 AM |
| How to parse a XML file using PERL and XML::DOm | girigopal | Shell Programming and Scripting | 0 | 06-27-2005 07:46 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Perl Parse
Hi
I'm writing simple perl script to parse the ftp log as below: Local directory now /home/user/testing 227 Entering Passive Mode (192,254,19,34,8,228). 125 Data connection already open; Transfer starting. 09-25-09 02:33PM 25333629 abc.tar 09-14-09 12:50PM 18015752 xyz.zip 09-14-09 12:50PM 7608056 test.zip 226 Transfer complete. local: abc.tar remote: abc.tar 227 Entering Passive Mode (192,254,19,34,8,230). my script below:- #!/usr/bin/perl $r=`/bin/cat ftplog`; @lines=split(/\n/,$r); foreach $line(@lines) { if ($line =~ m/ abc.tar$/i) { $remotefilesize=$line; print"$remotefilesize\n"; } } output parse as below:= 09-25-09 02:33PM 25333629 abc.tar local: abc.tar remote: abc.tar QUESTION?? how do i get 25333629 abc.tar only 25333629 Thank for help or guide |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|