Sign in to follow this  
Followers 0
mslabrat

Delete blank lines within Files / _ArrayPop update issue

3 posts in this topic

Hi all,

my problem is that I will catch some .ini files and each line in the files ends up with an CR+LF. (This ensures that the Delimiter will work line by line]

This as has result that the the combined .ini file has all entries (e.g. 3 entries but 4 lines, or 10 entries but 11 lines and the last line is always empty).

When I do a _FileReadToArray the last array field will be EMPTY.

When I run the _ArrayPop to remove this entry -> the entry is gone. so far so good.

BUT the stupid Index $Array[0] is not updated with the new value ;) (eg. Index before 4 should be now 3 but it remains with 4)

This will kill the whole programm.

So I am looking for one of 2 possible solutions.

1. Get rid of the last line before it goes to the array

OR

2. _ArrayPop and then UPDATE the stupid Index

For both ways I was looking for a solution but can not find.

Any ideas (or alternate solutions)?

Suggestions extremley welcome :P

Thanks in advance

mslabrat :D

Share this post


Link to post
Share on other sites



The last array is always empty?

_ArrayDelete($Array, Ubound($Array)-1)

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