Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validating Uploaded Files

Status
Not open for further replies.

gmail2

Programmer
Jun 15, 2005
987
IE
OK I'll try to explain this as best I can. I've got a form which will be used to upload CSV files. the CSV files are then inserted in to a MySQL database. There are 4 different files and the user will select which table to put the file into. However, obviously the tables aren't all the same structure. Some have dates in certain columns etc. So how can I say if tablename is this - use this template to format the data. if tablename is soemthing else, use a different template? I don't even know if template is the right word I'm looking for. I just thought maybe it was possible to create a "template file" which says format field 1 as text, field 2 as maketime() etc etc.

Hopefully somebody can help me out???
 
Personally I scan the first line of the CSV file (which contains the headings of columns for my datasets) and use that to decide what table I will insert the CSV into. I believe you will have to do some of your own processing to make this decision.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top