OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

how can I populate a calc document with the files on a CD?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
andrearicci
General User
General User


Joined: 06 Oct 2007
Posts: 17
Location: Italy

PostPosted: Sat Oct 06, 2007 9:23 am    Post subject: how can I populate a calc document with the files on a CD? Reply with quote

I wish to keep a database (even a calc sheet) with the files on my removable media (such an mp3 collection on CD, or a data backup DVD).
The macro should give me the choice of the directory to be listed, then add the files to the current db/calc file (maybe it should be a macro running only from the current document).
As I am a beginner, knowing almost nothing about programming, I really need help.
I found that the default macro Gimmiks>ReadDir would be a great starting point to retrive the file list from a chosen directory, but I'm not able to convert it in anything else.
As a first step, I would like to have a CD/DVD ID code in the first column (possibly the modified Gimmiks>ReadDir>ReadFolderDlg dialog could ask me for one) a second column with the directory path and a third with the filename.
I then wonder if there is the ability to extract some other file informations such exif jpeg data, file creation date, or avi/mp3 codec informations.
Any help is welcome.
Thank you
Back to top
View user's profile Send private message
pitonyak
Administrator
Administrator


Joined: 09 Mar 2004
Posts: 3655
Location: Columbus, Ohio, USA

PostPosted: Wed Oct 10, 2007 8:08 pm    Post subject: Reply with quote

How many files will you have? More than 32000?

Assume that you have a Calc document with the files in a sheet.

Column A contains the ID for a specific removable media.

Column B contains file names.

You want to read the files off of a disk and store the file names in Column B. How do you know the disk ID?

I recommend that you learn to do the following:

1. Get and print Cell A1 from the first sheet.

2. Set the value of Cell B2 in the first sheet.

3. Figure out how many rows and columns are used in the first sheet.

Do you know how to do this?
_________________
--
Andrew Pitonyak
http://www.pitonyak.org/oo.php
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
andrearicci
General User
General User


Joined: 06 Oct 2007
Posts: 17
Location: Italy

PostPosted: Thu Oct 11, 2007 12:01 am    Post subject: Reply with quote

how many files? good question, i don't now, the collection can grow, but I can maybe split the collection trough different tabs by hand -i mean: when the collection is becaming too big I open a new tab (or new document) and run the macro on it, catching there the new files.
Going back to your questions:
No, I don't know how to do it. I've spent some time on the web to find instructions but I found the learning material not enough simple for a beginner.
I know the ones you said are the right steps, but for me it s difficult to find the appropriate "method" in the api list (i went trough all the Calc methods)
Then I guess the most difficult step for me will be, more than filling a cell, to find the next empty row when running the macro on an exhisting database- how could I avoid overwriting of cells?
Another good thingh would be for the macro to update the "data area" of the sheet to include the newly added rows.
Thank you very much
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group