Jump to content

Recommended Posts

Posted

I need to know how I can replace a specific cell in a CSV file

 

Example:

I have 10 data in my file

Shoe
Bed
Table
Chair
Dinning room
Television
Washing machine
Computer
Stove
Door

I need to replace the table with a bucket. How I do this?

Thanks for the help

Posted (edited)

I have tried this code and it also tries StringRegExpReplace but it doesn't work

#include <File.au3>

Local $datos = FileOpen (@UserProfileDir&"\Desktop\ChatsActivos.csv");, $FO_APPEND)
    $informacionLeida = FileRead($datos)
    $filasArrary = StringSplit($informacionLeida,@CR,2)
    $NumberActive = StringSplit($filasArrary[$s],";",2)
    FileWrite($NumberActive[0][1],$vActual&";"&$gActual)
    FileClose($datos)

Compartir.au3

Edited by Jos
  • Developers
Posted (edited)

Just to get you started, something like this should be close:

$Input = FileRead(@UserProfileDir&"\Desktop\ChatsActivos.csv")
FileWrite(@UserProfileDir&"\Desktop\ChatsActivos-new.csv",StringRegExpReplace($Input,"table","bucket"))

Change the Regex in case you need to refine the replace search.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...