I am reading data from a vendor via an ftpwebrequest in c#. Thus the data will be in a string format line by line e.g
0123030014030300123003120312030203013003104234923942348
I need to parse this data into the appropriate fields so I can then insert them into a sql talble. I know the position each field starts at so I want to use regex to parse each field. This is the function I use to get the data now I just need to parse the data. I am haveing trouble finding a clear solution on how to do so. Any suggestions would be greatly appreciated :)
static void GetData()
{
WebClient request = new WebClient();
string url = "ftp://ftp.WebSite.com/file";
request.Credentials = new NetworkCredential("userid", "password");
try
{
byte[] newFileData = request.DownloadData(url);
string fileString = System.Text.Encoding.UTF8.GetString(newFileData);
Console.WriteLine(fileString);
}
catch (WebException e)
{
}
}