Jump to content

[Solved] StringSplit with @CRLF and parameter 1 doesn't work


aVen9er
 Share

Recommended Posts

A file contains over 200 lines. When I run this:

$str_list1 = FileRead($file_name)
$arr_list1 = StringSplit($str_list1, @CRLF, 1)

Array contains only 1 element. $arr_list1[0] = 1

It should contain over 200 elements. $arr_list1[0] > 200

Help file sais:

 

Quote

StringSplit ( "string", "delimiters" [, flag = 0] )

flag [optional] Changes how the string split works, add multiple flag values together if required:
    $STR_CHRSPLIT (0) = each character in the delimiter string will mark where to split the string (default)
    $STR_ENTIRESPLIT (1) = entire delimiter string is needed to mark the split

I think with old version of AutoIt it worked fine. Has something changed lately?

 

 

EDIT:

I figured it out. Sorry, my mistake

A file was Unicode, not ANSI. When I changed it to ANSI it works fine

Edited by Jos
Link to comment
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
 Share

×
×
  • Create New...