Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an array and grabbing data

Status
Not open for further replies.

JCrou82

Programmer
Aug 23, 2002
265
US
I have a script currently that goes through a directory and prints out every filename, filesize, filedate, etc. of all the files in the directory.

I want to basically put this information into an array as a "table". I want to do something like this...

file filename filesize filedate
0 fileA.doc 12 Kb 10/20/02
1 new-file.txt 25 Kb 02/15/03


I already have all the columns from each file, but what I don't know is how to put this information into an array, and then be able to print it out. So if I wanted this particular directory into an array and then I wanted to just print out all the file where the date is equal to yesterdays date lets say, I would access every "record" or value in the array and then compare yesterdays date with the date under filedate. I would then print out everything in the record.... Is there a way to do this?

I am not looking into placing it into a database because its temporary and will change everyday and everyminute.


Thanks to all in advance
 
There are myriad ways to do what you describe.

But I'm confused. If you are able to open a directory and get all the files in it, then get all the attributes for each file and store all that data in an array, I would think traversing an array and outputting HTML would be child's play. Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top