What I'd like to do is create a textfile and then import the whole thing
into a table. So, naturally, I've a few questions.
Do I need to include the column heads as a line in my textfile, or can I
simply go straight to the data?
Assuming, no column heads are necessary--because they're already there
in the table I've previously created--I'm looking at something like this
(the double quotes at the start of each line are deliberately empty
because the first column is an auto_increment column):
"", 'jack', 'sprat', '1 Main St', 'apt 2L', 'Anytown', 'NY', '10000',
'20030912154545'
"", 'john', 'doe', '45 Hoover St', 'apt 8B', 'Anytown', 'NY', '10000',
'20030912154555'
"", 'jane', 'smyth', '9 Fifth Ave', 'apt 2L', 'Anytown', 'NY', '10000',
'20030912154615'
Now, do I put items in the single quotes, or is that only for when I'm
typing stuff directly into the table via a command line situation? Do I
separate entries using "\t"--no quotes, of course--without any spaces,
commas, or tabs? And end each line with "\r"? (Or "\n"? Or both?) Like so:
""\t'jack'\t'sprat'\t'1 Main St'\t'apt
2L'\t'Anytown'\t'NY'\t'10000'\t'20030912154545'\r
"", 'john'\t'doe'\t'45 Hoover St'\t'apt
8B'\t'Anytown'\t'NY'\t'10000'\t'20030912154555'\r
"", 'jane'\t'smyth'\t'9 Fifth Ave'\t'apt
2L'\t'Anytown'\t'NY'\t'10000'\t'20030912154615'\r
Steve Tiano
- Re: Populating a Table with Data by Inserting a Textfi... Stephen Tiano
- Re: Populating a Table with Data by Inserting a T... Carl Anthony-uzoeto