Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Extracting relational data from flat file CSV
Message
De
30/09/2010 09:29:13
Mike Cole
Yellow Lab Technologies
Stanley, Iowa, États-Unis
 
 
À
29/09/2010 21:09:49
Information générale
Forum:
ASP.NET
Catégorie:
Bases de données
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Database:
MS SQL Server
Divers
Thread ID:
01483281
Message ID:
01483354
Vues:
38
>>>Looking for ideas about doing a one-time data extraction from a CSV (which was generated from Adobe PDFs)
>>>
>>>The data represents an insurance policy. 30% of the columns - which have column headers that correspond to field names - represent columns that will be imported into the policy table. The remainder of the columns are a flat representation of child tables.
>>>
>>>prop1, prop2, prop3, prop4 should be extracted to four rows of the prop table ( as well as the key representing the policy, of course )
>>>
>>>ai1, ai2, ai3 etc ditto.
>>>
>>>One-time conversion to sql server database. Any suggestions on the best way to iterate the 500 or so rows of the CSV to create 500 policy records and their associated child data.
>>>
>>>TIA
>>
>>A different approach from Naomi's (probably more simplified):
>>
>>Have you thought about opening the CSV file in Excel and using formulas to build insert statements? When it's a one-time load this is usually my approach of choice and it's fairly easy to do.
>
>Hmmm, that is really a new one on me. I am an Excel idiot and probably wouldn't know where to begin writing a formula to spit out the inserts.
>
>It strikes me that since there will be a fixed number of columns for each child I could begin by building the parent table and all the child tables with each child table containing the appropriate number of rows and with pk and fk columns populated. Then it would be just a matter of putting corresponding values from the csv into the tables.
>
>BTW, I am not adverse to farming this project out if somebody wants to look at the CSV and give me a bid.

Email it over...
Very fitting: http://xkcd.com/386/
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform