The online racing simulator
Getting row index in file system
Hello everyone, after a long time. I am facing a problem regarding a detailed system I have built.



I created a user infrastructure as shown in the picture, and it is created by default for each logged-in user, but when reading the data (readfile method), it takes the entire line, but I only want to get the 0's, 1's at the end or other data, for example, the 9th value of the 17th line or the 17th value. How can I get the part from the 9th to the 15th value of the line? It can be done with indexof or indexrange in C# language.
Attached images
Ekran görüntüsü 2024-01-24 224626.png
#2 - gu3st
It might be beneficial to use a format like JSON that can easily be serialized/parsed into a nice object rather than an INI like this?

Then you don't need to worry about parsing the file. You can pretty easily just readFile => parse to object => <do thing> => serialize and write if modified

Or, I suppose, if you wanna keep INI then use a proper INI parser like https://github.com/rickyah/ini-parser rather than baking it yourself
** Best answer **
As I think that you already have created a loop to go through the content of the file, you should add SplitToArray to that loop.
The value to make the split on will be "=" which will then give you an array for each line, with the following content in the array for each line read:

position 0 of the array: name of the value
position 1 of the arry: value

Example:

position 0 of the array: ban
position 1 of the arry: 0
Quote from Yisc[NL :;2075908"]As I think that you already have created a loop to go through the content of the file, you should add SplitToArray to that loop.
The value to make the split on will be "=" which will then give you an array for each line, with the following content in the array for each line read:

position 0 of the array: name of the value
position 1 of the arry: value

Example:

position 0 of the array: ban
position 1 of the arry: 0

I would like to inform you that when we used this code with our teammate, inspired by your comment, I got the result we wanted, thank you.

$idxSpace = indexOf( $Line, "=");
$car = subStr( $Line,0,$idxSpace );
Ah, well thought of and even a better solution than mine.
-
(CRAAACH) DELETED by CRAAACH : anankastic moment, don't mind

FGED GREDG RDFGDR GSFDG