AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Read past errant 1A (eof) char in text file

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
LBJ



Joined: 03 May 2007
Posts: 16

PostPosted: Tue Sep 18, 2007 3:12 am    Post subject: Read past errant 1A (eof) char in text file Reply with quote

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
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5887

PostPosted: Tue Sep 18, 2007 8:36 pm    Post subject: Reply with quote

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.

Smile
Back to top
View user's profile Send private message
LBJ



Joined: 03 May 2007
Posts: 16

PostPosted: Wed Sep 19, 2007 12:26 am    Post subject: Reply with quote

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
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 5887

PostPosted: Wed Sep 19, 2007 7:49 am    Post subject: Reply with quote

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 ? Smile
Back to top
View user's profile Send private message
LBJ



Joined: 03 May 2007
Posts: 16

PostPosted: Wed Sep 19, 2007 8:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group