Previous Thread
Next Thread
Print Thread
Rate Thread
#102629 04/22/2001 12:57 AM
Joined: Apr 2001
Posts: 8
Junior Member
Junior Member
Offline
Joined: Apr 2001
Posts: 8
Ok heres the deal, I am trying to parse the 'LIST' output of any unix directory. A file entry goes something like this:

drwx------ 5 anpatel students 512 Jan 13 2000 Desktop

Simple way of getting each field is:
my @properties = split(/s+/,$line);

But this code has one specific flaw. What if the file was "New Text Document.txt", there would be no way saying that $properties[9] was the full name of the file. I thought of improving the code:

my @properties = split( /s+/, $item );
my ( $perms, $lCount, $owner, $group, $size, $mod_mon, $mod_date, $mod_time ) = @properties;
my $file = join( "", @properties[8.. $#properties] );

But $file will be "NewTextDocument.txt" because the &join will compine all the rest of array elements with "".

I was looking for a perfect solution if some one could offer, of-course i am on the hunt. But lets see if some one figures out before me wink hehehe

Thanks for reading this!

Sponsored Links
Entire Thread
Subject Posted By Posted
Regular Expressions HelloWorld 04/22/2001 7:57 AM
Re: Regular Expressions Mark Badolato 04/22/2001 8:31 AM
Re: Regular Expressions HelloWorld 04/22/2001 8:46 PM
Re: Regular Expressions HelloWorld 04/22/2001 8:58 PM
Re: Regular Expressions Dave_L 04/23/2001 1:15 AM
Re: Regular Expressions HelloWorld 04/23/2001 3:27 AM
Re: Regular Expressions HelloWorld 04/23/2001 4:01 AM
Re: Regular Expressions AllenAyres 05/09/2005 8:24 AM
Re: Regular Expressions AllenAyres 05/09/2005 9:48 PM
Re: Regular Expressions Burak 05/09/2005 10:10 PM
Re: Regular Expressions AllenAyres 05/09/2005 10:34 PM
Re: Regular Expressions Burak 05/09/2005 10:48 PM
Re: Regular Expressions AllenAyres 05/09/2005 11:16 PM
Re: Regular Expressions Burak 05/10/2005 12:07 AM
Re: Regular Expressions AllenAyres 05/10/2005 8:16 AM
Re: Regular Expressions Burak 05/10/2005 1:52 PM
Re: Regular Expressions AllenAyres 05/10/2005 3:16 PM
Re: Regular Expressions Burak 05/10/2005 3:52 PM
Re: Regular Expressions Burak 05/10/2005 3:57 PM
Re: Regular Expressions AllenAyres 05/10/2005 6:18 PM
Re: Regular Expressions BLESSY JOSE 09/15/2005 3:40 PM

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online 769
Topics Created 0
Posts Made 0
Users Online 0
Birthdays 0
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,835
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)