I have text file which contains line like this:
@relation SMILEfeatures
@attribute pcm_LOGenergy_sma_range numeric
@attribute pcm_LOGenergy_sma_maxPos numeric
@attribute pcm_LOGenergy_sma_minPos numeric...
Where are about 6000 lines of these attributes, after attributes where are lines like this:
@data
1.283827e+01,3.800000e+01,2.000000e+00,5.331364e+00
1.850000e+02,4.054457e+01,4.500000e+01,3.200000e+01...
I need to seperate these strings in two different arrays. So far I only managed to store everything in one array.
Here is my code for storing in array:
using (var stream = new FileStream(filePath, FileMode.OpenOrCreate))
{
using (var sr = new StreamReader(stream))
{
String line;
while ((line = sr.ReadLine()) != null)
{
sb.AppendLine(line);
}
}
string allines = sb.ToString();
Console.WriteLine(sb);
}
All strings after @relation SMILEfeatures and contains @attribute are stored in first array. All the strings after @data should are stored in the second array. Hope this is what you wanted.