logged_with_bugmenot Posted February 28, 2007 Share Posted February 28, 2007 I have an upload form on my page that excepts .xls or .csv files, and I need to find a way to extract the rows of the file and store them in a database. I have done this the reverse way (pulling items from mysql and exporting as .xls files), but I'm not sure how to parse the values out of the file that is uploaded. If anyone has encountered this, and knows a simple (or complex) way to get these values, that information would be greatly appreciated in advance. Thanks. Link to comment https://forums.phpfreaks.com/topic/40553-extracting-data-from-an-uploaded-xlscsv-file/ Share on other sites More sharing options...
flappy_warbucks Posted February 28, 2007 Share Posted February 28, 2007 as CSV files are pretty standered in the layout as value1,value2,value3\n then you could write a script that would load the whole file into a single varable, split that into an array and then from there, you would then write several functions to handle the removal of the comma's and also to find the newlines and so on. i did write a script to do that, but i appear to have misplaced it, but thats how i done it, and it worked. Link to comment https://forums.phpfreaks.com/topic/40553-extracting-data-from-an-uploaded-xlscsv-file/#findComment-196236 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.