I have a huge text file, far too big for the whole thing to be paged into memory. All I need to do with this text file is edit the first line (its a CSV file and I need to alter the titles).
Is there a simple way I can do this in bash?
You can use
Another way is to split the file, edit and join again:
If your modification changes the length of the line, the whole file needs to be re-written, see for example this discussion on SO. You should probably consider saving the data to a database.
Keeping that in mind, you can stream edit the file with sed. To replace the first line, do something like this (GNU sed):