I have a scenario where data is read from a database and written to a csv file. The data has 3 columns Name, Date and Price.If the csv doesn't exist, a new file is created and the dat开发者_JAVA技巧a is written. If the csv does exist, I have to insert the data relative to the Date data already in the csv. How can I go about doing this?
Easiest way is to parse your csv back in a datastructure, append the data from the database and sort on the date. Then overwrite the file with the sorted data.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论