I have a little piece of code in which I can read a CSV file and then my code converts the accounts in the CSV file to IBAN accounts.
Somehow this gives me an error:
using (var client = new WebService.BANBICSoapClient("IBANBICSoap"))
{
StreamReader sr = new StreamReader(@"C:\CSV\test.csv");
StreamWriter sw = new StreamWriter(@"C:\CSV\testOut.csv");
while (sr.Peek() >= 0)
{
string line = sr.ReadLine();
try
{
string[] rowsArray = line.Split(';');
line = string.Empty;
string account = rowsArray[0];
string rel = rowsArray[1];
string res = acc;
string rest = acct;
if (resultIBAN != string.Empty && resultBIC != string.Empty)
{
line = account + ";" + res +";" + rest + ";" + rel;
}
else
{
line = account + ";" + "0" + ";" + "0" + ";" + rel;
}
}
catch (Exception msg)
{
Console.WriteLine(msg);
}
sw.WriteLine(line) ;
}
sr.Close();
sw.Close();
}
}