There are two functions I use that make quick work of CSV files - FileIO and CSV. FileIO loads a file into an array of lines or writes an array of lines to a file. CSV translates between a CSV formatted string and an array. Here's some sample code (assumes you've included the two UDFs).
 Code:
$aRecords = FileIO('.\data.csv', 'R') ; load file data to array
$NRecs = UBound($aRecords) ; get number of records
For $Rec = 0 to $NRecs
  $aFields = CSV($aRecord[$Rec]) ; convert CSV string to array


  ; Examine the appropriate fields from $aFields and perform the
  ; necessary task(s)
  ; If you need to modify the record,
  ; just change the element in the $aFields array - the code below
  ; handles the update


  $TRec = CSV($aFields)          ; convert from array to CSV string
  If $TRec <> $aRecord[$Rec]     ; was it changed?
    $aRecord[$Rec] = $TRec       ; replace it!
    $Modified = 1                ; show it was modified
  EndIf
Next
If $Modified                     ; was the data changed?
  If FileIO('.\data.csv', 'W', $aRecords)
    'Updated! ?
  Else
    'Update failed - ' @SERROR ?
  EndIf
EndIf
If you aren't modifying the data, the first three lines of the script show how to load the data into an array, enumerate the array, and convert the CSV Data to an array of fields. From there, the logic is pretty basic - use ReadValue to read the registry, compare the data, and Move to rename the path.

You'll want to grab the latest copies of these UDFs from the Resources page on my web site - they've been updated recently.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D