On 12/06/11 12:52, (Ted Harding) wrote:
On 12-Jun-11 11:14:10, Chris Walker wrote:
I have a spreadsheet which is currently in OpenOffice ods format but obviously can easily be saved in another format should I need to.
The spreadsheet holds roughly 6200 rows with 8 columns. I'd like to import 6 of those columns into an SQLite database and more to the point, do it automatically/programmatically rather than by hand.
There is another difficulty (it's difficult for me, it might not be for you!) is that I want the tables to be created from the names in column 3. Some of those columns are numerical and SQLite doesn't appear to like that.
The columns look like this :- Name1 Number Name2 Y/N Where Notes Unwanted1& Unwanted2
For Name2, the rows repeat so there might be half a dozen of the same names, like 1648, 8Sail, Abbeydale against the rows in Name1.
[snip]
Can you elaborate on "I want the tables to be created from the names in column 3"?
This isn't my data but imagine a list of pub names in Name1, a score in Number, Brewery Name in Name2, Yes/No in Y/N, a simple address in Where and random text in Notes.
I want the table to be called the Brewery Name e.g. Woodfordes.
Basically, this looks as though it would be a smooth little job using 'awk', with some backup from a simple shell wrapper, but the details would depend on how you want the extraction to come out at the end of the day. An example, maybe?
I hope my example above illustrates what I want to do.