https://www.xmos.com/published/how-read ... -execution
I quickly looked over this document and syscall.h but I don't see a way to move the pointer to the start of a specific line on a text file. I am currently using _read to read in a line into a buffer variable. _lseek seems to move the pointer in steps of bytes but my lines of text have varying characters at the ends. Would creating a function to detect newline characters and using it with _lseek work? Since the file is potentially millions of lines long i feel it will be very resource intensive.
Thanks
Seeking for a line in file I/O
-
- Active Member
- Posts: 33
- Joined: Sat Mar 12, 2016 3:12 pm
-
- XCore Expert
- Posts: 972
- Joined: Thu Dec 10, 2009 9:20 pm
- Location: Bristol, UK
Can we take a step back a moment? What are you ultimately trying to achieve? (I'm just thinking there might be a better way to do it than reading txt files..)
-
- Active Member
- Posts: 33
- Joined: Sat Mar 12, 2016 3:12 pm
Matlab creates a text file (200000+ lines long) with a bunch of parameters that are used by the startKIT to control a speaker.
The startKIT goes through the file line by line each loop to get the parameters for the next task.
The startKIT goes through the file line by line each loop to get the parameters for the next task.