Update the last line while writing the current line during writing to a file in julia

Hi. I need to create a file with four columns, say startTimes, startLocs, routeNds, and edgesTravelTimes. Because each column has different length, I figured that I can only use a normal txt file, or a csv file, without using DataFrames. The tricky part is, I need to create/write the file line by line. By the time I was writing the current line, the last two entries of the precious line might need to be updated. I was wondering, would this be possible? Any comments are greatly appreciated.

I don’t think that anything tabular like CSV is the right format then. Depending on the element types, consider JSON, BSON, or JLD2, and just write out a bunch of vectors.

If you really do want a tabular format, just pad the vectors to have equal length and use dataframes.