Sign in to follow this  
Followers 0
Humberto

StringSplit from FileReadLine

3 posts in this topic

My script is reading in from a file. The .txt file is in this format.

SomeNumber******Description

$line = FileReadLine($file)

The FileReadLine reads fine the entire line. I've verified this by displaying teh $line content. My problem is here with the StringSplit().

$array = StringSplit($line, "******")

The problem I have is that when I display $array for each item I don't get anything for $array[2]

This is my results

$array[0]= 4

$array[1]= SomeNumber

$array[2]=

NOTE: I've tested the split() with a string that is part of my script and it parses fine.

I will also like to use tab delimiter instead of ******. Can anyone help?

Thanks,

HV

Share this post


Link to post
Share on other sites



$array = StringSplit($line, "******", 1)
oÝ÷ Ú'ò¢ìÛhr§ëay×¥g­z¶®¶­s`¢b33c¶ÆæRÒ7G&æu&WÆ6Rb33c¶ÆæRÂgV÷C²¢¢¢¢¢¢gV÷C²ÂD"


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

After making your changes it worked fine using @TAB delimiter. Thanks

:whistle:

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