Importing Raw Data
Your manager has returned from her vacation. You quickly learn that
while she was relaxing at South Beach (Miami) she's been
thinking of ways to improve your xbasic programming skills. It's
comforting to know that she was thinking of you, but ...
In any case here's your assignment grasshopper:
Create a contacts table with the following field specifications:
First name, length of 35
Last name, length of 60
Address 1, length of 55
Address 2, length of 55
City, length of 30
State, length of 2
Zip Code, length of 5
Prepend your initials to "_Contact.dbf" as the table name.
For example my initials are TEC. My table will be called TEC_Contact.dbf
Import the data contained in IM_1.csv (attached) into your table.
IM_1.csv is a comma seperated values table.
The File layout is given as the first line of the file.
Disclosure Notice: the data in IM_1.csv was exported from the Customer table of AlphaSports.
INSTRUCTIONS
a) Write an xbasic script that will create the table, open the data (CSV) file, and import it into the table. Naturally, the script must correctly parse each line of the CSV file, assigning the desired column values
to the correct fields in each record of your table.
b) Your script should check to see if the table already exists, and get permission from your user before doing the import if the table already exists.
c) The import need not overwrite existing table records, nor does it need to replace matching table records.
d) Export your script and attach your solution to a reply here.
ps. If you like this puzzle thank Andy Schone who thought it up. Thanks, Andy!
Your manager has returned from her vacation. You quickly learn that
while she was relaxing at South Beach (Miami) she's been
thinking of ways to improve your xbasic programming skills. It's
comforting to know that she was thinking of you, but ...
In any case here's your assignment grasshopper:
Create a contacts table with the following field specifications:
First name, length of 35
Last name, length of 60
Address 1, length of 55
Address 2, length of 55
City, length of 30
State, length of 2
Zip Code, length of 5
Prepend your initials to "_Contact.dbf" as the table name.
For example my initials are TEC. My table will be called TEC_Contact.dbf
Import the data contained in IM_1.csv (attached) into your table.
IM_1.csv is a comma seperated values table.
The File layout is given as the first line of the file.
Disclosure Notice: the data in IM_1.csv was exported from the Customer table of AlphaSports.
INSTRUCTIONS
a) Write an xbasic script that will create the table, open the data (CSV) file, and import it into the table. Naturally, the script must correctly parse each line of the CSV file, assigning the desired column values
to the correct fields in each record of your table.
b) Your script should check to see if the table already exists, and get permission from your user before doing the import if the table already exists.
c) The import need not overwrite existing table records, nor does it need to replace matching table records.
d) Export your script and attach your solution to a reply here.
ps. If you like this puzzle thank Andy Schone who thought it up. Thanks, Andy!
Comment