c# - How to add a value to a existing .csv file -
i have information in .csv file @ click of button, add 1 number.
so data table:
years last paid: 2012 2012 2012 2012
and @ click of button, on selected columns
years last paid: 2013 2013 2012 2013
so in laymans terms, how add 1 selected column when press button
i dont have attempt because dont know how google search it, if there questions please ask, have in 3 hours present
try this
list<string> str = file.readalltext(@"completefilepath").split('\n').tolist(); list<string> updatedvalues = new list<string>(); foreach (var value in str) { int val = 0; if (int.tryparse(value, out val)) { updatedvalues.add((val + 1).tostring()); } } file.writealllines(@"completefilepath", updatedvalues);
Comments
Post a Comment