Sign in to follow this  
Followers 0
Guest hhravn

Reading from file

5 posts in this topic

#1 ·  Posted (edited)

Im trying to read from this file, but the read functions only return the first char of the file :whistle: Anyone got any ideas?

result.txt

Edited by hhravn

Share this post


Link to post
Share on other sites



Ok, it seems that every char is followed by a char(10), and EOL is double char(10). Any way to fix this?

Share this post


Link to post
Share on other sites

Ok, it seems that every char is followed by a char(10), and EOL is double char(10). Any way to fix this?

<{POST_SNAPBACK}>

I have no idea if this will work or if the syntax will work - I hate posting from a computer where I cannot test code before posting...

$file = FileRead($filename, FileGetSize($filename))
$lines = StringSplit($file, char(10)&char(10), 1)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

I have no idea if this will work or if the syntax will work - I hate posting from a computer where I cannot test code before posting...

$file = FileRead($filename, FileGetSize($filename))
$lines = StringSplit($file, char(10)&char(10), 1)

<{POST_SNAPBACK}>

Thanks for the reply (and the effort). Sadly it doesn't really work. I still get a string i can't print to screen. What i want to do is remove any occurences of a single chr(10), and replace double chr(10) with a single.

Share this post


Link to post
Share on other sites

Now that I can test it, I see the problems, I just don't have the solutions.

I also see that I typed char(10) instead of chr(10)...

Perhaps the info in this post might help:

http://www.autoitscript.com/forum/index.ph...04&st=0&p=88958


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0