I want to parse attached binary file. Binary files contains multiple records having same structure .Therefore i have set some chunk to differentiate between multiple records.But this is File dependent..
Tried below code but it is not generic for all files:
static List<string> SplitString(int chunk, string input)
{
List<string> list = new List<string>();
int cycles = input.Length / chunk;
if (input.Length % chunk != 0)
cycles++;
for (int i = 0; i < cycles; i++)
{
try
{
if ((i + 1) * chunk < input.Length)
list.Add(input.Substring(i * chunk, chunk));
else
list.Add(input.Substring(i * chunk));
}
catch
{
}
}
return list;
}