Dryden Posted February 22, 2008 Share Posted February 22, 2008 Hi guys. I need some help.I'm tring to read the fields of a file the problem is that this kind of files are all messed up.I already have the file contents in a string and it goes something like this:EX:bla bla bla bla bla bla +bla bla bla ++bla bla bla bla ++++bla bla bla ++bla bla bla ++++bla bla bla bla ++bla bla ++++++bla bla bla ++++bla bla blaso I wanted to split the variable whenever I encounter 4 plus signs (++++), and show each one of the variables.thx in advance. "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett. Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted February 22, 2008 Share Posted February 22, 2008 lookup StringSplit() and _ArrayDisplay() in the helpfile .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
Dryden Posted February 22, 2008 Author Share Posted February 22, 2008 (edited) I already tried StringSplit, the problem is that I can't make it work with "++++" as a delimiter, cos it acts the same either I put "+" or "++" or "+++", and I want it only to split in "++++" and btw I don't know how many ++++ there will be, so I can't define the array. isn't there a way to count them before creating the array? Edited February 22, 2008 by Dryden "Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life." - Terry Pratchett. Link to comment Share on other sites More sharing options...
weaponx Posted February 22, 2008 Share Posted February 22, 2008 StringSplit ( "string", "delimiters" [, flag ] ) [optional] If flag is 0 (the default), then each character in the delimiter string will mark where to split the string. If flag is 1, then the entire delimiter string is needed to mark the split. flag needs to be 1 Link to comment Share on other sites More sharing options...
DW1 Posted February 22, 2008 Share Posted February 22, 2008 ok... in your example you show "+++++" (5 plus') but want to detect "++++" (4 plus'). So should the "+++++" (5 plus') be detected as a "++++" (4 plus')? If so, would you want the string after the last plus or only after the fourth (meaning the string would start with "+")? This may be a job for StringRegExp() AutoIt3 Online Help 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