ExcelTextFormat Whitesapce

Apr 2, 2015 at 11:28 AM
Hi Developer,

I am using new EPPLUS library. I am having problem with different whitespace in input text file.
Here is my sample program code:
FileInfo newFile = new FileInfo("output.xlsx");
using (ExcelPackage package = new ExcelPackage())
{
var worksheet = package.Workbook.Worksheets.Add("SheetName");
var format = new ExcelTextFormat();
format.Delimiter = ' ';
worksheet.Cells["A1"].LoadFromText(new FileInfo("input.txt"), format);
package.SaveAs(newFile);
}

Here is my Input text file:
AA____BB______BB___MM

It has different space or cap so how to format delimiter all whitespace?
I tried format.Delimiter = '@\s+'; but not working
I am trying from 2-3 hours continuously still i have no clue :(

i want input read (as above) to xlsx file write (output) like this:
AA BB BB MM

Any Idea?
I am waiting for your response.

Thanks