I have CSV files upwards of 20 MB. I need to prepend a variable to the beginning of each line.
I thought about opening up the file and and reading each line in one by one, prepending it, then writing it to a second file. Once the second file is finished the first one will be deleted.
Or I was thinking of loading it into memory all at once into a variable then doing a regex to to prepend that.