Great thanks Mark. ----- Original Message ----- From: "Mark M" <[EMAIL PROTECTED]> To: "CFAussie Mailing List" <[EMAIL PROTECTED]> Sent: Wednesday, November 26, 2003 4:04 PM Subject: [cfaussie] Re: multicharacter delimiter
> Hey Gavin - > > The way I see it your have 3 different options for doing what you want: > > 1) Split the string up as a list with '_' as the delimiter, and then strip off the alpha characters > from each part after that. i.e you know listeGetAt(1) will have a q on it - so get rid of it. > > 2) Use regular expressions to grab the parts you need. > > 3) Utilise the java.util.StringTokenizer to do the splitting for you - as it will split with > multicharacter delimeters. > > Depending on where you knowledge is best at - either one of those roads should take you > where you want to go. > > HTH > > Mark > ------------------------------------------------------------------ > [EMAIL PROTECTED] > ICQ: 3094740 > Safe From Bees > [ www.safefrombees.com ] > > > Quoting Gavin Cooney <[EMAIL PROTECTED]>: > > > Hi All, > > > > I have a quite simple question for you... > > > > I have a series of file names like this: > > > > q1_b34_s1_1234.pdf where "q1" represents "Question 1", "_b34" represents > > "Band 3/4" and "_s1_1234" represents "Sample 1, student number 1234" > > > > I want to do something like: > > > > <!--- remove the .pdf extension from the file name ---> > > <cfset sample_substr = listfirst(attributes.file_name, ".")> > > <!--- Get the bit after the _s ---> > > <cfset sample_substr = listlast(sample_substr, "_s")> > > > > But "_s" is treated as two different as two different delimeters in the > > listlst function. > > > > From the docs: > > "Delimeter: A string or a variable that contains one. Character(s) that > > separate list elements. Default: comma. > > If this parameter contains more than one character, ColdFusion processes each > > occurrence of each character as a delimiter; you cannot specify a > > multicharacter delimiter." > > > > How could I do a multi character delimeter? > > > > Is the only option to do a findnocase for the "_s" and then do mid statements > > to get the substring? > > > > Thanks > > > > Gav > > > > > > > > > > > > --- > > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > > To unsubscribe send a blank email to [EMAIL PROTECTED] > > > > > > > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia > > http://www.mxdu.com/ + 24-25 February, 2004 > > > > --- > You are currently subscribed to cfaussie as: [EMAIL PROTECTED] > To unsubscribe send a blank email to [EMAIL PROTECTED] > > MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia > http://www.mxdu.com/ + 24-25 February, 2004 --- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] MXDU2004 + Macromedia DevCon AsiaPac + Sydney, Australia http://www.mxdu.com/ + 24-25 February, 2004
