OrangeTrading: I wish to read through csv files and then write info directly after the read info.
You can't modify existing lines (changing their size,) only add past the end. Read all lines in to an array, modify the array, and seek to the beginning of the file and write everything.
whroeder1:
You can't modify existing lines (changing their size,) only add past the end. Read all lines in to an array, modify the array, and seek to the beginning of the file and write everything.
You can't modify existing lines (changing their size,) only add past the end. Read all lines in to an array, modify the array, and seek to the beginning of the file and write everything.
Thanks for your reply.
The thing is, there are multi millions of lines in the CSV files. Putting it all in arrays would take lots of RAM.
Is there any other way?
OrangeTrading: here are multi millions of lines in the CSV files. Putting it all in arrays would take lots of RAM. Is there any other way?
- Read a line, write a modified line to a temp file; repeat. Delete the original file and rename the temp file.
- Alternatively use a binary file, no change in size required. Remember the location, read, modify, seek, write; repeat.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi guys,
I wish to read through csv files and then write info directly after the read info.
Now, I know how to read through the CSV file, but I don't know how I can:
-move downwards in the csv file
-then go back to a specific point
-then add data next to the current data
Any help would be so much appreciated.