[Solved] Importing from Calc CSV file

dBase, Calc, CSV, MS ACCESS, MySQL, PostgrSQL, OTHER
Post Reply
georgegraz
Posts: 7
Joined: Tue Nov 29, 2022 4:45 pm

[Solved] Importing from Calc CSV file

Post by georgegraz »

I am trying to import From Calc.

Filename                     Fullname                        DateCreated         Filesize
2021-10-12 Central Ave.dwg   J:\2021-10-12 Central Ave.dwg   8/18/2016 03:27     12345678

I can manually enter this data into the table. But if I copy - paste, I get errors. 1 of them is S1000 Generalerror java.lang.nullpointerexception in statement. Continue anyways? I've tried creating different formats. no luck. Filename & fullname can start with letters or numbers. This is my 1st time using the programs.
Thanks for the help

 Edit: Added formatting tags -- MrProgrammer, forum moderator  
Last edited by Hagar Delest on Wed Nov 30, 2022 10:53 pm, edited 1 time in total.
Reason: tagged solved.
OpenOffice 4.1 on Windows 10
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Importing from Calc CSV file

Post by FJCC »

The dwg file extension is not typical of a CSV file. Are you sure it is a CSV? How exactly are you using Copy - Paste to import the data?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
georgegraz
Posts: 7
Joined: Tue Nov 29, 2022 4:45 pm

Re: Importing from Calc CSV file

Post by georgegraz »

that is the filename. I have a number of USB hard Drives & Memory sticks. With a program, it gives me a csv file of all the files on that Drive or stick. So my header is
Filename Fullname Date Created Filesize

Filename: 2021-10-12 Central Ave.dwg the filename is any Legal windows filename, so it can start with a letter or number.
Fullname: J:\2021-10-12 Central Ave.dwg This is the Filename & folder - location
Date Created format: 8/8/2016 03:27 This is the format for the date & time
Filesize: 1234567 this is the size of the file. Because will will surpass the limit of excel, I can't store all the info in Excel.
This is so, if I'm looking for a specific file, I can search for it, then plug in that particular stick or hard drive.
Thanks
OpenOffice 4.1 on Windows 10
georgegraz
Posts: 7
Joined: Tue Nov 29, 2022 4:45 pm

Re: Importing from Calc CSV file

Post by georgegraz »

I tried using Excel. After a few 4 gig Hard Drives, you could have over 1 million files. So, I wanted to take all the csv files ( 1 for each USB stick or hard drive) info & combine them into a searchable database. Thats what I'm trying to do. every record is the same format, Filename, Fullname, Datecreated,filesize. I'm doing it the way I found how to's. Last way I tried it was to declare fullname & filename as a Memo [lonvarchar]. It still shows up an error when trying to import them. I will try the "search inside". Thanks for the responses so far.
OpenOffice 4.1 on Windows 10
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Importing from Calc CSV file

Post by FJCC »

Please post a small example file of a csv. It just needs to have a few rows of data.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
georgegraz
Posts: 7
Joined: Tue Nov 29, 2022 4:45 pm

Re: Importing from Calc CSV file

Post by georgegraz »

Added a file. I think. Thanks
Attachments
One small folder.csv
(5.77 KiB) Downloaded 222 times
OpenOffice 4.1 on Windows 10
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Importing from Calc CSV file

Post by FJCC »

Here is how I would connect to that file.
Save the file in a folder containing no other files
1. Add column names to the file
2. Start a new database file with File -> New -> Database
3. Select Connect To An Existing Database
4. Choose Text from the drop down list
5.Click Next
6.Browse to the folder containing the file. In this step you choose the folder, not the file.
7. Specify the type of file you want to access as Commas Separated Values file
8. Set the Field Separator to TAB
9. Click Next and accept defaults

You should now see one table in the database named after your file. You can add more data by appending to the existing file.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Importing from Calc CSV file

Post by John_Ha »

Your csv file is pretty horrible as some gaps are spaces while others are tabs.

Recreating the csv file using fixed width fields may be easiest.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
georgegraz
Posts: 7
Joined: Tue Nov 29, 2022 4:45 pm

Re: Importing from Calc CSV file

Post by georgegraz »

FJCC, that worked perfect!! I have like 50 files
USB001.csv
USB002.csv
etc.
I want to end up with 1 table. How do I now add the next one?
Thanks
OpenOffice 4.1 on Windows 10
georgegraz
Posts: 7
Joined: Tue Nov 29, 2022 4:45 pm

Re: Importing from Calc CSV file

Post by georgegraz »

Or, can each one have its own Table, then the Query will search all tables?
Thanks
OpenOffice 4.1 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Importing from Calc CSV file

Post by Villeroy »

Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Importing from Calc CSV file

Post by Villeroy »

Merging many text files into one is a trivial task on regular operating systems. On Windows you may try the "power shell": https://duckduckgo.com/?t=ffab&q=merge+ ... ell&ia=web
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Importing from Calc CSV file

Post by FJCC »

@georgegraz
You can merge text files using the Command Prompt in Windows. Open the Command Prompt and navigate to the folder holding all your text files. Ask if you do not know how to do this. I assume none of the files have headers. Run this command

Code: Select all

copy /b *.csv AllDat.csv 
That will make a new file named AllDat.csv holding all of the data. Then move all of the individual csv files to another folder. You can now add a row of column headers to AllDat.csv

When you get new file named USB100.csv (again, I assume no headers) you can run

Code: Select all

copy /b AllDat.csv+USB100.csv AllDat.csv
to append the new data to AllDat.csv.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Importing from Calc CSV file

Post by Villeroy »

FJCC wrote: Wed Nov 30, 2022 8:08 pm copy /b *.csv AllDat.csv
This does not skip the header rows.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
FJCC
Moderator
Posts: 9280
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Importing from Calc CSV file

Post by FJCC »

Villeroy wrote: Wed Nov 30, 2022 8:11 pm This does not skip the header rows.
That is true. I believe the original files do not have headers.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
georgegraz
Posts: 7
Joined: Tue Nov 29, 2022 4:45 pm

Re: Importing from Calc CSV file

Post by georgegraz »

They don't. I'm in the process of running a program that will tell me every file on the drive. Then adding a number associated with the drive. Then I will combine them as suggested.
Thanks for all the help.
George
OpenOffice 4.1 on Windows 10
Post Reply