RE: Heh |
||
![]() ![]() Delta Cpt dopel Well, I still think Excel is the best approach. Its two clicks to sort and it has the benefit of giving the user the ability to sort any which way they like. If you want to go the code route, here is how you can query a csv file as if it were a database. My code is in VBscript. sql = "SELECT * FROM sample.csv" path = "C:\" ConStr = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" & path Set conn1 = CreateObject("ADODB.Connection") Set thisObjRS = CreateObject("ADODB.recordset") conn1.ConnectionString = ConStr conn1.Open Set thisObjRS = conn1.Execute(sql,,adExecuteNoRecords) If you want to port this to PHP, it is easily done. http://phphelp.web.cern.ch/phphelp/Examples/Database.asp On 2008-08-05 11:55:11, Goatrider wrote >Nah, not homework or project for work, but I have always wondered how to sort CSV stuff in PHP (or Perl as Ens demonstrated). > >In the scenario, I figured the best thing for a salesman to do would be to download a file from a website and then re-upload it to another one. It doesn't require any manual sorting like dopel suggested, so it's the bare minimum of work for them to do. > >The reason I didn't want to use a shell script or something to that effect was because salesmen don't normally have access to a shell to run the file. I suppose I could have easily have said use VB.NET to make a GUI app, but I figured PHP (I hadn't thought of perl or ruby, but those would work too) would be more inclusive to the skills of our userbase, and what internet salesman cant use a web browser? ;-) > >--goat Replies:
|
||
| CyberArmy::Forum v0.6 Generated In 0.00644 seconds |