CyberArmy University | Open Source Institute | CyberArmy Intelligence & Security | CyberArmy Services & Projects

RE: Heh


[Replies] [Reply] [View by Thread] [Help]
[Back To Programming]

Posted by Delta Cpt dopel On 2008-08-05 15:45:41
In Reply to Heh Posted by Gamma Cpt Goatrider On 2008-08-05 11:55:11

Delta CptDelta Cpt
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:


Guest:
Subject:
Message:
Signature:
Optional Image Link:
http://

CyberArmy::Forum v0.6
Generated In 0.00644 seconds


About Us | Privacy Policy | Mission Statement | Help