Open File Path & Loop to Read Records & Check If Record Exis

I need to open a file path to import records from csv file into my database using PMI. My data consist of:

Primary Key : Information
1 5.5
2 3.4
3 4.4
ect…

I need some help with the syntax to:
Open File Path
Loop to read Read Record While they Exist
Check to see if primary key already exist, if yes I’ll do an update else insert

Thanks

Some of the examples in this post should get you started:
viewtopic.php?f=23&t=2379&start=0&st=0&sk=t&sd=a&hilit=csv