using NPOI.XSSF.UserModel;
static void Main(string[] args)
string inputFilePath = "ParsingText.XLS";
string outputFilePath = "ParsingTextFinal.XLS";
string delimiter = "stringx";
using (FileStream fs = new FileStream(inputFilePath, FileMode.Open, FileAccess.Read))
IWorkbook wb= new XSSFWorkbook(fs);
ISheet sheet = wb.GetSheetAt(0);
for (int rowIndex = 0; rowIndex <= sheet.LastRowNum; rowIndex++)
IRow row = sheet.GetRow(rowIndex);
ICell cell = row.GetCell(0);
string originalText = cell.StringCellValue;
string[] parts = originalText.Split(new string[] { delimiter }, StringSplitOptions.None);
lhsString = parts[0].Trim();
rhsString = parts[1].Trim();
lhsString = RemovePunctuation(lhsString);
rhsString = RemovePunctuation(rhsString);
row.CreateCell(1).SetCellValue(lhsString);
row.CreateCell(2).SetCellValue(rhsString);
using (FileStream fs1= new FileStream(outputFilePath, FileMode.Create, FileAccess.Write))
static string RemovePunctuation(string text)
return text.Replace(".", "").Replace(",", "").Replace("?", "");