I want to read CSV file and if decrement a field in the same CSV file. How can i do this in Java?
            Asked
            
        
        
            Active
            
        
            Viewed 591 times
        
    0
            
            
        - 
                    what do you mean by "if decrement a field in the same CSV file"? Please clarify. – Adarsh Bhat Dec 22 '15 at 05:20
 
1 Answers
0
            
            
        Apache commons has a CSV parser https://commons.apache.org/proper/commons-csv/
        dolan
        
- 1,716
 - 11
 - 22
 
- 
                    I got how to read using common-csv jar but not how to update a specific field. Can you please give an example ? – Mohit Jain Dec 22 '15 at 05:45
 - 
                    You are not going to be able to update in place (files are stored linearly on disk). But you can read from a file replace the lines or fields you want to change and then write out the new CSV. See http://stackoverflow.com/questions/4397907/updating-specific-cell-csv-file-using-java – dolan Dec 22 '15 at 05:54