From: Tad McClellan on
James Egan <jegan473(a)comcast.net> wrote:


[ snip where a nice soul has tried to solve the OP's poorly specified problem ]


> I should have mentioned that the dates, sizes, names, of the files, might be
> different, so they won't always start at position 50.


No, you should not have mentioned that.

You should have provided test data that reflects your real data.


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
From: Tad McClellan on
James Egan <jegan473(a)comcast.net> 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


That is not three array elements.

my @ra = (
"-rwxrwxrwx 1 777 22000 2971201 Jan 24 18:17 file1.zip\n",
"-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",
);


_That_ is three array elements.

You should speak Perl rather than English, when possible.

Have you seen the Posting Guidelines that are posted here frequently?


--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.liamg\100cm.j.dat/"
The above message is a Usenet post.
I don't recall having given anyone permission to use it on a Web site.
From: Uri Guttman on
>>>>> "JE" == James Egan <jegan473(a)comcast.net> writes:

JE> Assume the files vary greatly in size. Then the file names may
JE> not start at position 50 like:

JE> -rwxrwxrwx 1 777 22000 2971201 Jan 24 18:17 file1.zip
JE> -rwxrwxrwx 1 777 22000 9941 Jan 28 18:10 file2 onespace.zip
JE> -rwxrwxrwx 1 777 22000 3002969941 Jan 29 13:28 file3 two spaces.zip

so what have you tried? you can always skip the first fixed fields. or
you can match them with a regex. even something as trivial as a set of
\S+ parts with \s+ separators will do. the number of fields is fixed
too. so try a regex with that hint and see what you can do. if you still
have troubles, post what code you have tried. this is really an easy
problem which is why i am not giving you a direct answer.

uri

--
Uri Guttman ------ uri(a)stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
From: Uri Guttman on
>>>>> "JK" == John Kelly <jak(a)isp2dial.com> writes:

JK> On Wed, 30 Jun 2010 21:08:27 -0400, "Uri Guttman" <uri(a)StemSystems.com>
JK> wrote:

JK> Try to relax. It's only Perl. Or does Perl make you tense.

>> no, just bad and/or useless perl makes me react. you seem to be a font
>> of it. i will correct your posted code whenever i feel like it. note
>> that others didn't even come close to your way off response to the same
>> ambiguous OP. and you still never answered my question, what was your
>> code trying to even show? reading and printing a file of line
>> (regardless of their being file names) doesn't do anything close to what
>> the OP wanted. so your analytical skills need to be honed as well. best
>> you sit back and not respond to most posts here until you have seen what
>> others have to say.

JK> Criticism is one thing. When it's mean and personal, it's trolling.

JK> Why would I want to follow the advice of a troll.

well, cause i am not a troll. but your perl code suggestions are weak at
best. i paTROL this group and correct/improve bad code. you are just a
recent target. nothing new. it isn't personal. i don't like to see poor
perl posted and will always comment on it. you can take it personally,
but that is your issue not mine. i care about the code.

uri

--
Uri Guttman ------ uri(a)stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
From: Uri Guttman on
>>>>> "JK" == John Kelly <jak(a)isp2dial.com> writes:

JK> On Wed, 30 Jun 2010 21:08:27 -0400, "Uri Guttman" <uri(a)StemSystems.com>
JK> wrote:

>> best you sit back and not respond to most posts here until you have
>> seen what others have to say

JK> The second "N" in NNTP means "news." If you don't have any news to
JK> share, maybe answering questions is all you can do. But don't expect
JK> everyone else to be like you. I sometimes have news to post. Which
JK> reminds me ...

you don't get this group at all. it discusses perl. all posts here are
open to comments about the perl in them. the exclusively news aspect of
usenet or nntp is long gone. your bringing that up is just silly. silly!
silly! silly!

uri

--
Uri Guttman ------ uri(a)stemsystems.com -------- http://www.sysarch.com --
----- Perl Code Review , Architecture, Development, Training, Support ------
--------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------