Reading csv file

hi, how do i search a csv file?.
I have a table with 3 columns (Employee ID , salary ,grade ) If i will enter an Employee ID and it should return the salary and grade of that employee id. Need reply soon .
thank you in advance
Last edited on
You wouldn't normally search a CSV file (or JSON or XML ...), they represent serialised data/objects that should be deserialised before processing.

So, read the CSV file into something and search that.
However, the serialization exists only on a per-record basis.

It would be sufficient to simply read the file on a line-by-line basis, and s.find( employee_id ) to determine whether or not you should bother deserializing the record into fields.
Topic archived. No new replies allowed.