Re: Parsing file names with spaces
- From: John Kelly <jak@xxxxxxxxxxxx>
- Date: Thu, 01 Jul 2010 00:22:21 +0000
On Wed, 30 Jun 2010 23:53:13 GMT, James Egan <jegan473@xxxxxxxxxxx>
wrote:
I want to take these three array elements and extract the file names which
include spaces:
-rwxrwxrwx 1 777 22000 2971201 Jan 24 18:17 file1.zip
-rwxrwxrwx 1 777 22000 2969941 Jan 28 18:10 file2 onespace.zip
-rwxrwxrwx 1 777 22000 2969941 Jan 29 13:28 file3 two spaces.zip
This works for me:
#!/usr/bin/perl
open DATA, 'data';
@files = <DATA>;
foreach (@files) {
my $file;
(undef, undef, undef, undef, undef, undef, undef, undef, $file) = split ' ', $_, 9;
$file =~ / / and print "$file";
}
--
Web mail, POP3, and SMTP
http://www.beewyz.com/freeaccounts.php
.
- Follow-Ups:
- Re: Parsing file names with spaces
- From: Uri Guttman
- Re: Parsing file names with spaces
- References:
- Parsing file names with spaces
- From: James Egan
- Re: Parsing file names with spaces
- From: Uri Guttman
- Re: Parsing file names with spaces
- From: James Egan
- Re: Parsing file names with spaces
- From: John Kelly
- Re: Parsing file names with spaces
- From: James Egan
- Parsing file names with spaces
- Prev by Date: Path to another server
- Next by Date: Re: Parsing file names with spaces
- Previous by thread: Re: Parsing file names with spaces
- Next by thread: Re: Parsing file names with spaces
- Index(es):
Relevant Pages
|