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 to load CSV data

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
jwf
General User
General User


Joined: 22 Oct 2006
Posts: 6
Location: Canada

PostPosted: Sun Oct 22, 2006 8:50 pm    Post subject: how to load CSV data Reply with quote

Hi, I've just created a single table, and a form OK. Now I'd like to load the table with previously captured data. This data is in comma delimited form. How can load all 500 rows of data into the existing table?

Thank you.
Back to top
View user's profile Send private message
Robert Tucker
Moderator
Moderator


Joined: 16 Aug 2004
Posts: 3407
Location: Manchester UK

PostPosted: Mon Oct 23, 2006 12:20 am    Post subject: Reply with quote

You could import to Calc as a spreadsheet and then follow:

http://sheepdogguides.com/fdb/fdb1imp1.htm

Otherwise you might have a look at:

http://www.oooforum.org/forum/viewtopic.phtml?t=21157&view=next

(Not tried the second method myself.)

Don't know if you can use something like:

LOAD DATA INFILE "/address_to_csv/xyz.csv" INTO TABLE table_name;

at Tools>SQL which would work for MySQL (try it with and without the semi-colon).
Back to top
View user's profile Send private message
jwf
General User
General User


Joined: 22 Oct 2006
Posts: 6
Location: Canada

PostPosted: Mon Oct 23, 2006 5:09 am    Post subject: Reply with quote

Thanks Robert,
I was able to create a new table and populate it with the data using the first method. I'll try the second method to see if I can't get the data into an already created table.
Note: some quirky things about this Base, the SQL query converts the table name to upper case, and will not execute unless you rename your tables in uppercase.

Anyway, Thanks for your suggetions.
Back to top
View user's profile Send private message
Robert Tucker
Moderator
Moderator


Joined: 16 Aug 2004
Posts: 3407
Location: Manchester UK

PostPosted: Mon Oct 23, 2006 5:14 am    Post subject: Reply with quote

I just tried the LOAD DATA INFILE MySQL method - it doesn't seem to recognize "LOAD".
Back to top
View user's profile Send private message
jwf
General User
General User


Joined: 22 Oct 2006
Posts: 6
Location: Canada

PostPosted: Mon Oct 23, 2006 8:07 am    Post subject: Reply with quote

Actually, after much playing, i'm able to get the tables loaded the way I want them.

Another quick question (may be another topic), but do you know if there is a way to automate the open database to a specific form? I'm trying to configure a shortcut that will open the dabase, navigate to form that will allow new entries to be logged.
I see that "record a macro" is not available until one opens a form.
Back to top
View user's profile Send private message
Robert Tucker
Moderator
Moderator


Joined: 16 Aug 2004
Posts: 3407
Location: Manchester UK

PostPosted: Tue Oct 24, 2006 12:32 pm    Post subject: Reply with quote

Afraid I don't know the answer to your last question.

There is another way to import a .csv file into Base (or rather create a database from a .csv file), I see:

www.oooforum.org/forum/viewtopic.phtml?t=27706

It doesn't have to be addresses (I imported a glossary) and you can call the database what you like, but you have to make the first line of your .csv the titles of your columns, I think you will find.

Also found a tool for creating sql statements from .csv files (but not sure it has much application within OpenOffice):

http://csvtosql.sourceforge.net/
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 Base 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