Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Export from SQL to Flat Format

Quote Reply
Export from SQL to Flat Format
I need to export from SQL tables to a pipe-delimited
flat format for offline work using Links 2.0.

I anticipate some combination of command-line MySQL,
folowed by grep, sed, etc on the dumped output ...

Does anyone know of an easier way to do this?


Quote Reply
Re: Export from SQL to Flat Format In reply to
Use the EXPORT option for each table...SQL DUMP will not do want you want....

To create tab delimited text files, simply use the EXPORT option in MySQLMan....

BTW: Rather than exporting flat files, you might want to consider configuring your local computer system to run Links SQL with MySQL, so that you don't have to continually export/import flat files...then you can simply do a SQL DUMP of your local copy of links and then execute the dump file in your virtual server.

Regards,

Eliot Lee
Quote Reply
Re: Export from SQL to Flat Format In reply to
When you export the Links table, is there anyway to make it work out the categories using CatLinks? Because when you do the export, it doesn't contain which category each link is in.

Quote Reply
Re: Export from SQL to Flat Format In reply to
Export each table individually.

Regards,

Eliot Lee Wink
http://anthrotech.com/
Quote Reply
Re: Export from SQL to Flat Format In reply to
Anthro,

Did you read my question above? I asked if it was possible to include the "Category" when exporting the Links table. If you just export the Links table then you are not told which category each of the links is in. Your answer doesn't make sense to this question. I need to know if there is a way of using CatLinks to insert the full category name in to the Links table, so I can then export it.

JeffB

Quote Reply
Re: Export from SQL to Flat Format In reply to
Hi,

I believe as of 2.0.4, the export would include category information (the category id and name) in the dump generated by Links->Properties->Export data.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: Export from SQL to Flat Format In reply to
Alex,

I was actually using Links2.03 but thanks anyway. I solved the problem by writing a small Perl script and using MS Excel to work out the correct category for each link.

Thanks

JeffB

Quote Reply
Re: Export from SQL to Flat Format In reply to
Hi jeffb

Is the script that you wrote something that you can make available here at Gossamer - perhaps in the Resources section?

Thanks Smile

DT

Quote Reply
Re: Export from SQL to Flat Format In reply to
DT,

Like I said, most of the work was done in Excel, using search and delete. The Perl script was run on my own computer (under Apache) and all it did was create a list of the categories based on the Link Cats table. I still had some problems after the script. In general you would be better creating your own solution. If anyone wants me to write a full script to change SQL to Links 2 then email my profile address for a price.

JeffB