[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Excel to Sql




> I like pipe delimited files, I just save it as tab-delimited files from
> excel and run a little sed script to convert the tab's to pipe's.
>
> Hope this helps.
>
> Brian
>
>
> On Wed, 1 Mar 2000, Anthony E. Greene wrote:
>
> > Eric Cifreo wrote:
> > >
> > > > Is there a way to import a table from an excel spread sheet to a
MySql
> > > table??
> > > >
> > > > Kirk
> > > >
> > >
> > > In Excel, select export to csv (comma separated value) file.
Transport this
> > > to your Linux machine, and take care of any Dos2Unix problems (like
^Ms,
> > > etc.).  Then go read this link:
> >
> > If MySQL can import tab-delimited files, then that's generally a better
> > choice, especially if any of the columns contain text that may include a
> > comma (deliberately or otherwise). Someone could accidently type a comma
> > instead of a period in an abbreviation or something. Such an
unintentional
> > comma could corrupt your import.
> >
> > In most data entry applications, a tab moves to another field or does
> > nothing. So it is unlikely that a tab will make it into a database
> > accidently. This makes tabs very good delimiters when
importing/exporting
> > data. In PostgreSQL, tab is the default delimiter.
> >
> > Tony

All of these suggestions are good and true but, ultimately, the question of
what delimiter you use is academic.  When you import text files into mySQL,
you can specify on the command line what field delimiter to use, what field
enclosure to use (you can wrap all values in double quotes to prevent commas
or tabs in fields from being read as a delimiter), etc.

I think MSOffice applications want to export to csv format out of the box.
I just remembered having trouble convincing Access to dump tables to tab
delimited files.  I had to write a VB routine to insert tabs programatically
and then do file I/0 to get it right....

At any rate, the answer to the original question is "Yes".  There's more
than one way to do it, they said perlishly.

Eric Cifreo
Austin, TX



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]