You're on the right track, but CSV files are potentially more complex than data separated by commas. You should use the CSV() udf to convert the CSV string to an array, examine and possibly change the values in the array, and pass the array back through CSV again to return it to a proper CSV string. Here's some conceptual code that checks the third field for the update:
 Code:
; rename the original file
Ren 'mydata.csv' 'temp.csv'
; open the work file
Open(2,'temp.csv')
; send output to the original file
$ = RedirectOutput('mydata.csv')
; read a line, convert CSV data to an array
$CSV = CSV(ReadLine(2))
While Not @ERROR
  ; if the array value matches, change it
  ; I'm assuming the third field in this example
  ; look for the value
  If Not InStr($CSV[3], 'change_me')
    $CSV[3] = 'Change_me'        ; change it
  EndIf

  ; Add the CSV string to the output file - pass the array back to CSV()
  ; the returned string will be redirected to the file
  CSV($CSV) ?

  ; get the next line into an array
  $CSV = CSV(ReadLine(2))

Loop

$ = Close(2)
$ = RedirectOutput('')

; delete the work file, unless you want to keep a backup
Del 'temp.csv'


You'll need to make the appropriate changes to the part of the code that checks foe the "bad" value and changes it to the "good" value, if it's any more complex that replace "X" with "Y", but the base logic here should work just fine.

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