[cfaussie] Re: String Manipulation
I think you might find a RegEx using back-referencing and look-ahead is the way to go... REReplace(variables.start_str,'(..)(?!$)','\1:\2','all'); Full test below. cfscript variables.start_str = '1Z0617756740260660'; variables.end_str = REReplace(variables.start_str,'(..)(?!$)','\1:\2','all '); writeOutput(variables.start_str 'br'); // Initial String writeOutput('1Z:06:17:75:67:40:26:06:60br'); // Target result writeOutput(variables.end_str); // Actual Result abort; /cfscript Rawdy On Thursday, July 11, 2013 12:28:23 AM UTC+10, rai...@ozemail.com.au wrote: Hi I am trying to figure our the best way to manipulate the value using CF so I insert : after ever 2 characters as in converting 1Z0617756740260660 to 1Z:06:17:75:67:40:26:06:60 Any suggestions would be appreciated Kind Regards Claude Raiola Director [image: logo_new] TrackingCentral Pty Ltd (A.C.N. 150 409 180) Web: www.TrackingCentral.com.au http://www.trackingcentral.com.au/ Email: in...@trackingcentral.com.au javascript: Call 1300 255 990 -- You received this message because you are subscribed to the Google Groups cfaussie group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie. For more options, visit https://groups.google.com/groups/opt_out.
[cfaussie] Re: String Manipulation
I think you might find a RegEx using back-referencing and look-ahead is the way to go... REReplace(variables.start_str,'(..)(?!$)','\1:','all'); Full test below. cfscript variables.start_str = '1Z0617756740260660'; variables.end_str = REReplace(variables.start_str,'(..)(?!$)','\1:\2','all '); writeOutput(variables.start_str 'br'); // Initial String writeOutput('1Z:06:17:75:67:40:26:06:60br'); // Target result writeOutput(variables.end_str); // Actual Result abort; /cfscript Rawdy On Thursday, July 11, 2013 12:28:23 AM UTC+10, rai...@ozemail.com.au wrote: Hi I am trying to figure our the best way to manipulate the value using CF so I insert : after ever 2 characters as in converting 1Z0617756740260660 to 1Z:06:17:75:67:40:26:06:60 Any suggestions would be appreciated Kind Regards Claude Raiola Director [image: logo_new] TrackingCentral Pty Ltd (A.C.N. 150 409 180) Web: www.TrackingCentral.com.au http://www.trackingcentral.com.au/ Email: in...@trackingcentral.com.au javascript: Call 1300 255 990 -- You received this message because you are subscribed to the Google Groups cfaussie group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie. For more options, visit https://groups.google.com/groups/opt_out.
[cfaussie] Re: String Manipulation
I think you might find a RegEx using back-referencing and look-ahead is the way to go... REReplace(variables.start_str,'(..)(?!$)','\1:\2','all'); Full test below. cfscript variables.start_str = '1Z0617756740260660'; variables.end_str = REReplace(variables.start_str,'(..)(?!$)','\1:','all'); writeOutput(variables.start_str 'br'); // Initial String writeOutput('1Z:06:17:75:67:40:26:06:60br'); // Target result writeOutput(variables.end_str); // Actual Result abort; /cfscript Rawdy On Thursday, July 11, 2013 12:28:23 AM UTC+10, rai...@ozemail.com.au wrote: Hi I am trying to figure our the best way to manipulate the value using CF so I insert : after ever 2 characters as in converting 1Z0617756740260660 to 1Z:06:17:75:67:40:26:06:60 Any suggestions would be appreciated Kind Regards Claude Raiola Director [image: logo_new] TrackingCentral Pty Ltd (A.C.N. 150 409 180) Web: www.TrackingCentral.com.au http://www.trackingcentral.com.au/ Email: in...@trackingcentral.com.au javascript: Call 1300 255 990 -- You received this message because you are subscribed to the Google Groups cfaussie group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie. For more options, visit https://groups.google.com/groups/opt_out.
[cfaussie] Re: String Manipulation
I think you might find a RegEx using back-referencing and look-ahead is the way to go... REReplace(variables.start_str,'(..)(?!$)','\1:','all'); Full test below. cfscript variables.start_str = '1Z0617756740260660'; variables.end_str = REReplace(variables.start_str,'(..)(?!$)','\1:','all'); writeOutput(variables.start_str 'br'); // Initial String writeOutput('1Z:06:17:75:67:40:26:06:60br'); // Target result writeOutput(variables.end_str); // Actual Result abort; /cfscript Rawdy On Thursday, July 11, 2013 12:28:23 AM UTC+10, rai...@ozemail.com.au wrote: Hi I am trying to figure our the best way to manipulate the value using CF so I insert : after ever 2 characters as in converting 1Z0617756740260660 to 1Z:06:17:75:67:40:26:06:60 Any suggestions would be appreciated Kind Regards Claude Raiola Director [image: logo_new] TrackingCentral Pty Ltd (A.C.N. 150 409 180) Web: www.TrackingCentral.com.au http://www.trackingcentral.com.au/ Email: in...@trackingcentral.com.au javascript: Call 1300 255 990 -- You received this message because you are subscribed to the Google Groups cfaussie group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie. For more options, visit https://groups.google.com/groups/opt_out.
Re: [cfaussie] Re: String Manipulation
That's some hot Regex. On Thu, Jul 11, 2013 at 11:11 AM, Rawdyn Nutting raw...@gmail.com wrote: I think you might find a RegEx using back-referencing and look-ahead is the way to go... REReplace(variables.start_str,**'(..)(?!$)','\1:','all'); Full test below. cfscript variables.start_str = '1Z0617756740260660'; variables.end_str = REReplace(variables.start_str,**'(..)(?!$)','\1:','all '); writeOutput(variables.start_**str 'br'); // Initial String writeOutput('1Z:06:17:75:67:**40:26:06:60br'); // Target result writeOutput(variables.end_str)**; // Actual Result abort; /cfscript Rawdy -- E: mark.man...@gmail.com T: http://www.twitter.com/neurotic W: www.compoundtheory.com 2 Devs from Down Under Podcast http://www.2ddu.com/ -- You received this message because you are subscribed to the Google Groups cfaussie group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie. For more options, visit https://groups.google.com/groups/opt_out.
[cfaussie] Re: string manipulation to find the value in a comma separated value record set of a specific length and syntax
I don't think you need to use list functions at all, you know the position and length, you can just grab it cfset a = '+RESP:GTSTT,070106,868487001009190,GT500,41,0,0.0,0,14.7,153.035960,-27.471336,20130704121354,0505,0002,1B8D,A281,00,006064939682,-66,20130704122355,0758$' / cfset b = '+RESP:GTTRI, 868487001009190,1,0,0,0,0.2,148,6.4,3,153.034551,-27.471390,20130610110953,0505,0002,1B6B,A281,00,0012,0103090402' / cfset imiea = mid(a, reFindNoCase([0-9]{15}, a), 15) / cfset imieb = mid(b, reFindNoCase([0-9]{15}, b), 15) / cfoutput #imiea# br #imieb# /cfoutput Dale On Thursday, 4 July 2013 23:35:18 UTC+10, rai...@ozemail.com.au wrote: Hi I have a csv data set with each record contains a set of comma separated values I am trying to write cf code to interrogate each record to find the value in the set of comma seated values that meets a specific character set In the examples below you can see the value 868487001009190 is located in position 3 of the first record and position 2 in the second record Record 1: '+RESP:GTSTT,070106,868487001009190,GT500,41,0,0.0,0,14.7,153.035960,-27.471336,20130704121354,0505,0002,1B8D,A281,00,006064939682,-66,20130704122355,0758$' record 2: '+RESP:GTTRI, 868487001009190,1,0,0,0,0.2,148,6.4,3,153.034551,-27.471390,20130610110953,0505,0002,1B6B,A281,00,0012,0103090402' Kind Regards Claude Raiola SAMARIS Software Call 1300 255 990 -- You received this message because you are subscribed to the Google Groups cfaussie group. To unsubscribe from this group and stop receiving emails from it, send an email to cfaussie+unsubscr...@googlegroups.com. To post to this group, send email to cfaussie@googlegroups.com. Visit this group at http://groups.google.com/group/cfaussie. For more options, visit https://groups.google.com/groups/opt_out.
[cfaussie] Re: String Manipulation
Yep, That's a problem. I had to do this once in the real world, a pain. Makes you think next you design a DB though. Regards Dale Fraser From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Ricardo Russon Sent: Monday, 4 February 2008 5:12 PM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: String Manipulation Now... how about dealing with 2 first names? Ann Maree Smith Marc Anthony Muniz Now how about: Mary Jane Mac Guinness? :D On Feb 4, 2008 3:57 PM, Dale Fraser [EMAIL PROTECTED] wrote: Steve is correct assuming they have a two + word name. But just in case cfset myName = 'Dale Fraser' / cfset firstName = listFirst(myName, ' ') / cfif listLen(myName) gt 1 cfset lastName = listLast(myName, ' ') / cfelse cfset lastName = '' / /cfif Otherwise if their name is 'Madonna' You would end up with Madonna Madonna Regards Dale Fraser http://learncf.com http://learncf.com/ From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steve Onnis Sent: Monday, 4 February 2008 4:43 PM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: String Manipulation #listFirst(members_name, )# gets first name #listRest(members_name, )# gets everything after the first name incase they have a middle name #listLast(members_name, )# gets the last value in the string _ From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Claude Raiola Sent: Monday, 4 February 2008 4:40 PM To: cfaussie@googlegroups.com Subject: [cfaussie] String Manipulation Hi, Yes its a very basic question however i have forgotten the correct syntax I have a field called members_name containing the first and last name of each member eg tom smith i am wanting to separate the first and last name into 2 columns, first_name, last_name I cannot recall the correct syntax in order to separate the string into 2 parts Regards Claude Raiola B.Econ (Acc), B.Hot.Mngt. Websites: www.AustralianAccommodation.com http://www.australianaccommodation.com/ www.SAMARIS.NET http://www.samaris.net/ www.WebSiteSolutions.com.au http://www.websitesolutions.com.au/ Mobile: 0414 228 948 On Mon Feb 4 12:56 , 'Barry Beattie' sent: yeah, and not winning the prizes. we've heard the sob stories. Imagine! people using the lure of prizes to encourage them to a CFUG meeting ... what is the world coming to? On Feb 4, 2008 2:50 PM, Toby Tremayne [EMAIL PROTECTED] wrote: I'm in your CFUG, eating your pizza. On 04/02/2008, at 12:16 , Mark Mandel wrote: Sorry.. who are you again? ;o) Mark On Feb 4, 2008 11:53 AM, Toby Tremayne [EMAIL PROTECTED] wrote: Yup I'll be there - will be speaking too. Toby On 02/02/2008, at 20:07 , MrBuzzy wrote: Hi folks... I'm in the midst of organising a trip to the UK in June. I'll be attending scotch on the rocks in Edinburgh and was wondering if any other (cf)Aussies will be going? Cheers. --- Life is poetry, write it in your own words --- Toby Tremayne Director Code Poet and Zen Master of the Heavy Sleep Lyricist Software 0416 048 090 ICQ: 13107913 -- E: [EMAIL PROTECTED] W: www.compoundtheory.com http://parse.pl/?redirect=http://www.compoundtheory.com --- Life is poetry, write it in your own words --- Toby Tremayne Director Code Poet and Zen Master of the Heavy Sleep Lyricist Software 0416 048 090 ICQ: 13107913 ) BR br --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: String Manipulation
#listFirst(members_name, )# gets first name #listRest(members_name, )# gets everything after the first name incase they have a middle name #listLast(members_name, )# gets the last value in the string _ From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Claude Raiola Sent: Monday, 4 February 2008 4:40 PM To: cfaussie@googlegroups.com Subject: [cfaussie] String Manipulation Hi, Yes its a very basic question however i have forgotten the correct syntax I have a field called members_name containing the first and last name of each member eg tom smith i am wanting to separate the first and last name into 2 columns, first_name, last_name I cannot recall the correct syntax in order to separate the string into 2 parts Regards Claude Raiola B.Econ (Acc), B.Hot.Mngt. Websites: www.AustralianAccommodation.com www.SAMARIS.NET www.WebSiteSolutions.com.au Mobile: 0414 228 948 On Mon Feb 4 12:56 , 'Barry Beattie' sent: yeah, and not winning the prizes. we've heard the sob stories. Imagine! people using the lure of prizes to encourage them to a CFUG meeting ... what is the world coming to? On Feb 4, 2008 2:50 PM, Toby Tremayne [EMAIL PROTECTED] javascript:top.opencompose('[EMAIL PROTECTED]','','','') wrote: I'm in your CFUG, eating your pizza. On 04/02/2008, at 12:16 , Mark Mandel wrote: Sorry.. who are you again? ;o) Mark On Feb 4, 2008 11:53 AM, Toby Tremayne [EMAIL PROTECTED] javascript:top.opencompose('[EMAIL PROTECTED]','','','') wrote: Yup I'll be there - will be speaking too. Toby On 02/02/2008, at 20:07 , MrBuzzy wrote: Hi folks... I'm in the midst of organising a trip to the UK in June. I'll be attending scotch on the rocks in Edinburgh and was wondering if any other (cf)Aussies will be going? Cheers. --- Life is poetry, write it in your own words --- Toby Tremayne Director Code Poet and Zen Master of the Heavy Sleep Lyricist Software 0416 048 090 ICQ: 13107913 -- E: [EMAIL PROTECTED] javascript:top.opencompose('[EMAIL PROTECTED]','','','') W: www.compoundtheory.com --- Life is poetry, write it in your own words --- Toby Tremayne Director Code Poet and Zen Master of the Heavy Sleep Lyricist Software 0416 048 090 ICQ: 13107913 ) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: String Manipulation
Steve is correct assuming they have a two + word name. But just in case cfset myName = 'Dale Fraser' / cfset firstName = listFirst(myName, ' ') / cfif listLen(myName) gt 1 cfset lastName = listLast(myName, ' ') / cfelse cfset lastName = '' / /cfif Otherwise if their name is 'Madonna' You would end up with Madonna Madonna Regards Dale Fraser http://learncf.com From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Steve Onnis Sent: Monday, 4 February 2008 4:43 PM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: String Manipulation #listFirst(members_name, )# gets first name #listRest(members_name, )# gets everything after the first name incase they have a middle name #listLast(members_name, )# gets the last value in the string _ From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Claude Raiola Sent: Monday, 4 February 2008 4:40 PM To: cfaussie@googlegroups.com Subject: [cfaussie] String Manipulation Hi, Yes its a very basic question however i have forgotten the correct syntax I have a field called members_name containing the first and last name of each member eg tom smith i am wanting to separate the first and last name into 2 columns, first_name, last_name I cannot recall the correct syntax in order to separate the string into 2 parts Regards Claude Raiola B.Econ (Acc), B.Hot.Mngt. Websites: www.AustralianAccommodation.com www.SAMARIS.NET www.WebSiteSolutions.com.au Mobile: 0414 228 948 On Mon Feb 4 12:56 , 'Barry Beattie' sent: yeah, and not winning the prizes. we've heard the sob stories. Imagine! people using the lure of prizes to encourage them to a CFUG meeting ... what is the world coming to? On Feb 4, 2008 2:50 PM, Toby Tremayne [EMAIL PROTECTED] javascript:top.opencompose('[EMAIL PROTECTED]','','','') wrote: I'm in your CFUG, eating your pizza. On 04/02/2008, at 12:16 , Mark Mandel wrote: Sorry.. who are you again? ;o) Mark On Feb 4, 2008 11:53 AM, Toby Tremayne [EMAIL PROTECTED] javascript:top.opencompose('[EMAIL PROTECTED]','','','') wrote: Yup I'll be there - will be speaking too. Toby On 02/02/2008, at 20:07 , MrBuzzy wrote: Hi folks... I'm in the midst of organising a trip to the UK in June. I'll be attending scotch on the rocks in Edinburgh and was wondering if any other (cf)Aussies will be going? Cheers. --- Life is poetry, write it in your own words --- Toby Tremayne Director Code Poet and Zen Master of the Heavy Sleep Lyricist Software 0416 048 090 ICQ: 13107913 -- E: [EMAIL PROTECTED] javascript:top.opencompose('[EMAIL PROTECTED]','','','') W: www.compoundtheory.com --- Life is poetry, write it in your own words --- Toby Tremayne Director Code Poet and Zen Master of the Heavy Sleep Lyricist Software 0416 048 090 ICQ: 13107913 ) BR --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---
[cfaussie] Re: String Manipulation
Now... how about dealing with 2 first names? Ann Maree Smith Marc Anthony Muniz Now how about: Mary Jane Mac Guinness? :D On Feb 4, 2008 3:57 PM, Dale Fraser [EMAIL PROTECTED] wrote: Steve is correct assuming they have a two + word name. But just in case cfset myName = 'Dale Fraser' / cfset firstName = listFirst(myName, ' ') / cfif listLen(myName) gt 1 cfset lastName = listLast(myName, ' ') / cfelse cfset lastName = '' / /cfif Otherwise if their name is 'Madonna' You would end up with Madonna Madonna Regards Dale Fraser http://learncf.com *From:* cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Steve Onnis *Sent:* Monday, 4 February 2008 4:43 PM *To:* cfaussie@googlegroups.com *Subject:* [cfaussie] Re: String Manipulation #listFirst(members_name, )# gets first name #listRest(members_name, )# gets everything after the first name incase they have a middle name #listLast(members_name, )# gets the last value in the string -- *From:* cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Claude Raiola *Sent:* Monday, 4 February 2008 4:40 PM *To:* cfaussie@googlegroups.com *Subject:* [cfaussie] String Manipulation Hi, Yes its a very basic question however i have forgotten the correct syntax I have a field called members_name containing the first and last name of each member eg tom smith i am wanting to separate the first and last name into 2 columns, first_name, last_name I cannot recall the correct syntax in order to separate the string into 2 parts Regards Claude Raiola B.Econ (Acc), B.Hot.Mngt. Websites: www.AustralianAccommodation.com http://www.australianaccommodation.com/ www.SAMARIS.NET http://www.samaris.net/ www.WebSiteSolutions.com.au http://www.websitesolutions.com.au/ Mobile: 0414 228 948 *On Mon Feb 4 12:56 , 'Barry Beattie' sent:* yeah, and not winning the prizes. we've heard the sob stories. Imagine! people using the lure of prizes to encourage them to a CFUG meeting ... what is the world coming to? On Feb 4, 2008 2:50 PM, Toby Tremayne [EMAIL PROTECTED] wrote: I'm in your CFUG, eating your pizza. On 04/02/2008, at 12:16 , Mark Mandel wrote: Sorry.. who are you again? ;o) Mark On Feb 4, 2008 11:53 AM, Toby Tremayne [EMAIL PROTECTED] wrote: Yup I'll be there - will be speaking too. Toby On 02/02/2008, at 20:07 , MrBuzzy wrote: Hi folks... I'm in the midst of organising a trip to the UK in June. I'll be attending scotch on the rocks in Edinburgh and was wondering if any other (cf)Aussies will be going? Cheers. --- Life is poetry, write it in your own words --- Toby Tremayne Director Code Poet and Zen Master of the Heavy Sleep Lyricist Software 0416 048 090 ICQ: 13107913 -- E: [EMAIL PROTECTED] W: www.compoundtheory.comhttp://parse.pl/?redirect=http://www.compoundtheory.com --- Life is poetry, write it in your own words --- Toby Tremayne Director Code Poet and Zen Master of the Heavy Sleep Lyricist Software 0416 048 090 ICQ: 13107913 ) BR --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups cfaussie group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~--~~~~--~~--~--~---