mslabrat Posted January 28, 2008 Share Posted January 28, 2008 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 Thanks in advance mslabrat Link to comment Share on other sites More sharing options...
Paulie Posted January 29, 2008 Share Posted January 29, 2008 The last array is always empty? _ArrayDelete($Array, Ubound($Array)-1) Link to comment Share on other sites More sharing options...
rasim Posted January 29, 2008 Share Posted January 29, 2008 More solutions Dim $iniFile = "c:\test.ini", $ReadFile, $result $ReadFile = FileRead($iniFile) $result = StringReplace($ReadFile, @CRLF & @CRLF, @CRLF) ConsoleWrite($result) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now