This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

find a char from file.txt

Hello,

I want to find the value of 4th char stocked in a file.txt .

for example . I have a file.txt that contains 1 23 35 76 46 77 ....
i want to return the value of 4th char witch is "76".

PS:In simulator , i can not creat a tab and i can not use pointer.

my final objective is to copy the data from a file to a region in the RAM .

can help me please
thank you

Parents
  • You say you have a text file that contains:
    "1 23 35 76 46 77 ...."

    You say that 76 is your 4th character. But if 1, 23, 35, 76, 46, 77 are the decimal values of the first characters in the file, then it doesn't look like a text file. The decimal values 1 or 23 does not correspond to characters I would expect to find in a text file.

    Of course you can work with tab characters in the simulator. You encode tab characters as '\t' or 9 or "\x09".

Reply
  • You say you have a text file that contains:
    "1 23 35 76 46 77 ...."

    You say that 76 is your 4th character. But if 1, 23, 35, 76, 46, 77 are the decimal values of the first characters in the file, then it doesn't look like a text file. The decimal values 1 or 23 does not correspond to characters I would expect to find in a text file.

    Of course you can work with tab characters in the simulator. You encode tab characters as '\t' or 9 or "\x09".

Children