How to Convert CSV to String, Modify It, and Convert Back to CSV?

Hi everyone,

I’m working on a project where I need to manipulate a CSV file in a more flexible way. Here’s what I want to do:

  1. Convert a CSV file to a string: I want to read the CSV file and convert its contents into a string so that I can perform modifications.
  2. Modify the string: After converting the CSV to a string, I need to make some changes to it.
  3. Convert the modified string back to a CSV file: Once I’ve made the necessary modifications, I want to save the string back to a CSV format.

I am struggling in step 3. Does anyone have suggestions or workflows for achieving this? I’m open to using various tools or scripting languages. Any guidance or examples would be greatly appreciated!

Thanks in advance!

Welcome to the Make community!

A CSV file is already a long text string by itself. You can use string functions and string modules on it.

To “convert” it back to CSV, you probably just need to upload to a cloud hosting provider like Google Drive, and name it with a .csv extension.

Hope this helps! Let me know if there are any further questions or issues.

You can also join us in the Make Fans Discord server to chat with other makers!

1 Like