using System.Text.RegularExpressions;
public static void Main()
string transaction ="136000099 :000067894:12345678/4966 0 01000374 1 Bristol ADV Manual 00021571200002157120000000000000000000000000000 4966 000067894 12345678 001 1 1 1 Apr 09 2018 2 lbolan 8288 8288 Check 0 BHM Adv COMM IDC.app 0.0.0.0.79.4 .1 Apr 09 2018 20180409-002I\0001001.tif 20180409-002I\0001001R.tif 20180409-002I\0001001Att1.tif F COKA 1 20180409002-IDC ";
transaction ="130100099 :000067894:12345678/4967 0 01000374 2 Piedmont Statements Manual 00031945360003194536000000000000000000000000000 4967 000067894 12345678 002 2 1 2 Apr 09 2018 2 lbolan 62500 62500 Check 0 BHM Adv COMM IDC.app 0.0.0.0.28.5 .2 Apr 09 2018 20180409-002I\0002001.tif 20180409-002I\0002001R.tif 20180409-002I\0002001Att1.tif F COKA 1 20180409002-IDC ";
string company = transaction.Substring(0,8);
string oldaccount1= transaction.Substring(150,10);
string oldaccount2 = transaction.Substring(160,10);
Console.WriteLine(company);
Console.WriteLine(oldaccount1);
Console.WriteLine(oldaccount2);
string test = CleanUpFileName("1!xyz123zy!");
public static string CleanUpFileName(string input)
string pattern = "[^A-Za-z0-9]";
string CleanUpFileName = Regex.Replace(input, pattern, replacement);