440LVB Posted November 26, 2007 Share Posted November 26, 2007 Hello I'm making a program where i need regexp. I use 3, but only 2 are actually working, while they're very similar... This is the piece of code where the problem is : ; Read in lines of text until the EOF is reached While 1 $line = FileReadLine($fileRead) If @error = -1 Then ExitLoop EndIf $energie = StringRegExp($line,'ISU;([GE]);',1) $readPDL = StringRegExp($line,'ISU;[GE];([0-9]{20});',1) $miseEnService = StringRegExp($line,';([0-9]{8})\n',1) If StringCompare($energie[0],"E") == 0 Then FileWriteLine($fileResultE,$readPDL[0] & ";" & $miseEnService[0]) Else FileWriteLine($fileResultG,$readPDL[0] & ";" & $miseEnService[0]) EndIf Wend It works well with $energie and $readPDL, but for $miseEnService, the compiler keeps telling me "Subscript used with non-Array variable" when I try to write the line. Any idea why it works with the 2 other variables and not this one? Thanks for help Link to comment Share on other sites More sharing options...
weaponx Posted November 26, 2007 Share Posted November 26, 2007 You should post an example of the $line variable so we know what it looks like. The 3rd regex statement clearly doesn't find a match in your line. 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