| View previous topic :: View next topic |
| Author |
Message |
LBJ
Joined: 03 May 2007 Posts: 16
|
Posted: Tue Sep 18, 2007 3:12 am Post subject: Read past errant 1A (eof) char in text file |
|
|
G'day All,
Is there an option (work-around) in AHK which will allow loop read to ignore an errant hex 1A eof character in the middle of an otherwise standard text file *without* resorting to reading the entire file into memory and performing a manipulation?
By default the loop read terminates when it hits the 1A char.
Thanks in advance for any feedback.
Best Regards,
LBJ |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5887
|
Posted: Tue Sep 18, 2007 8:36 pm Post subject: |
|
|
The target file can be opened at low-level and be set right before the Loop, Read. But this would be a terribly slower method if the target file is very large in size.
 |
|
| Back to top |
|
 |
LBJ
Joined: 03 May 2007 Posts: 16
|
Posted: Wed Sep 19, 2007 12:26 am Post subject: |
|
|
G'day Skan,
Thanks for that.
We've scanned through all the documentation and really decided there's no option. We now pre-process the file in binary mode prior to the text based access. It adds very little overhead, but we just thought there may be a more elegant solution.
Thanks very much for your input.
Best Regards,
LBJ |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 5887
|
Posted: Wed Sep 19, 2007 7:49 am Post subject: |
|
|
| LBJ wrote: | | We now pre-process the file in binary mode prior to the text based access. |
Just curious.. are you using AHK for that ?  |
|
| Back to top |
|
 |
LBJ
Joined: 03 May 2007 Posts: 16
|
Posted: Wed Sep 19, 2007 8:00 am Post subject: |
|
|
G'day Skan,
Yes.
We just block read it, remove any 0x1A characters, and then parse it to the mainline logic. It does the job without any drama.
Best Regards,
LBJ |
|
| Back to top |
|
 |
|