Celso Calomeno
New member
- Joined
- Oct 13, 2022
- Messages
- 3
- Programming Experience
- Beginner
If anyone can help me, I'm not able to convert the txt to include in the list
Ex. I need my txt file to stay on my lists this format:
C#:
string thePath = @"C:\Spectrum.txt";
string seq = File.ReadAllText(thePath);
//read the numbers by line
string[] text = Regex.Split(seq, "\t");
List<(double mz, double intensity)> ions = new List<(double mz, double intensity)>();
foreach (var a in ions)
{
//string to double conversion
ions.Add(double.Parse(text[0]), double.Parse(text[1]));
Console.WriteLine(a)
}
Ex. I need my txt file to stay on my lists this format:
C#:
116.8722915649414 mz
3017.10400390625 intensity
Last edited by a moderator: