Jump to content
Sign in to follow this  
Guest hhravn

Reading from file

Recommended Posts

Guest hhravn

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
Guest hhravn

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
herewasplato

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
Guest hhravn

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

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.