Hello. I have the following problem: There is a text (suppose in text.txt) and in it a text of approximately the following content:
Blablabla 9f3 KKK 33 Pos 1 44 23 TextV "Вертикальность не помешает!" Up 15
and I need to make it so that the second value is written to the variable, for example, 1 44 23 (from Pos) must be written to the position variable. I just tried to write my pathetic example, but ... after spending about an hour I didn’t think of anything (I just don’t know how to do it .. right now, I'll try again ..
StreamReader streamReader = new StreamReader("name.txt"); string str = ""; string []strLine; int i; string NamePos = "Pos"; int []position; while (!streamReader.EndOfStream) { int i; i++; str += streamReader.ReadLine(); strLine[i] = str.Split(new char[i][]{' '}, StringSplitOptions.RemoveEmptyEntries); }//считали все слова и записали в массив streamReader.Close(); if(strcmp(strLine[i][j], NamePos)) //сравниваем с нужной нам строкой {i++}else{while(!strLine[i][j]) {position[j] = strLine[i][j]; j++}} // копируем
something like that, but at over9000% sure that the code has billions of errors!