Thursday, 15 March 2012

c# - CSV (or excel) parsing ; eliminate empty column -



c# - CSV (or excel) parsing ; eliminate empty column -

i using textfieldparser class parse file. want eliminate or ignore finish column if "entire column" empty (which means single empty cell of perticular row should considered) possible?

note: per functionality, need utilize info copied clipboard. can not pass direct file path parser.

textfieldparser parser = new textfieldparser(new stringreader(row)); string[] delimiters = { ",", "\t" }; parser.setdelimiters(delimiters); string[] columns = null; while (!parser.endofdata) { columns = parser.readfields(); }

appreciate help.

after reading through textfieldparser class page on msdn, see there nil written there create me think class can ignore whole column. have manually. furthermore, code not seem right because trying read fields repeatedly same variable:

while (!parser.endofdata) { columns = parser.readfields(); }

c# .net wpf excel csv

No comments:

Post a Comment