Re: [cfaussie] String Manipulation

2013-07-11 Thread Chris Velevitch
On Thu, Jul 11, 2013 at 3:15 PM, Robin Hilliard ro...@rocketboots.com.auwrote:


 I should point out that because the recursion is on the last line of the
 function this is tail recursive - the compiler will notice this and
 optimise the code by throwing away the current stack frame (which would
 have been used by later statements in the function had they existed) each
 time the recursive call is made, so you don't need to worry about a stack
 overflow - this is how functional languages iterate efficiently.


Are you saying that Railo does tail recursion optimisation?  Do you know if
ACF does tail recursion optimisation?


Chris
--
Chris Velevitch
Manager - Adobe Platform Users Group, Sydney
m: 0415 469 095
www.apugs.org.au

Adobe Platform Users Group, Sydney
Topic: TBD
Date: Monday, 29th July
Details and RSVP on http://www.meetup.com/Sydney-Adobe-Platform-User-Group

-- 
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] String Manipulation

2013-07-11 Thread Robin Hilliard
On 12/07/2013, at 8:07 AM, Chris Velevitch chris.velevi...@gmail.com wrote:

 On Thu, Jul 11, 2013 at 3:15 PM, Robin Hilliard ro...@rocketboots.com.au 
 wrote:
  
 I should point out that because the recursion is on the last line of the 
 function this is tail recursive - the compiler will notice this and 
 optimise the code by throwing away the current stack frame (which would have 
 been used by later statements in the function had they existed) each time the 
 recursive call is made, so you don't need to worry about a stack overflow - 
 this is how functional languages iterate efficiently.
 
 
 Are you saying that Railo does tail recursion optimisation?  Do you know if 
 ACF does tail recursion optimisation?

Actually I'd like to make a (very surprising to me) correction - unlike many 
VMs and interpreters for other languages the Sun JVM does not support hard 
(in VM) tail call optimisation, whereas the IBM JVM does support it where 
possible. There is ongoing discussion as to whether or not Java 8 will support 
it. I assumed tail call optimisation was universal - it's not hard to 
implement, for example little virtual machine I wrote for my Greener Threads 
talk at CFOANZ included tail call optimisation for a simple subset of cfscript. 
Apparently the java permission mechanism and the need to include a stack trace 
in exceptions have prevented it to date.

I do not know off hand if ColdFusion or Railo support any soft tail call 
optimisation when compiling CFML to byte code. 

Thanks,
Robin

 



Robin Hilliard
Chief Technology Officer


RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australia   map
Phone   +61 2 9323 2507
Facsimile   +61 2 9323 2501
Mobile  +61 418 414 341
email   ro...@rocketboots.com
web www.rocketboots.com.au




-- 
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.


inline: rb_logo.png

Re: [cfaussie] String Manipulation

2013-07-11 Thread Mark Mandel
I'd be pretty surprised if it did. Clojure requires you to avoid the
footgun of TCO on the JVM by using special constructs.  I'd be pretty sure
CFML would be similar.  This is why we get StackOverFlowExceptions :)

Mark


On Fri, Jul 12, 2013 at 9:38 AM, Robin Hilliard ro...@rocketboots.com.auwrote:

 On 12/07/2013, at 8:07 AM, Chris Velevitch chris.velevi...@gmail.com
 wrote:

 On Thu, Jul 11, 2013 at 3:15 PM, Robin Hilliard ro...@rocketboots.com.au
  wrote:


 I should point out that because the recursion is on the last line of the
 function this is tail recursive - the compiler will notice this and
 optimise the code by throwing away the current stack frame (which would
 have been used by later statements in the function had they existed) each
 time the recursive call is made, so you don't need to worry about a stack
 overflow - this is how functional languages iterate efficiently.


 Are you saying that Railo does tail recursion optimisation?  Do you know
 if ACF does tail recursion optimisation?


 Actually I'd like to make a (very surprising to me) correction - unlike
 many VMs and interpreters for other languages the Sun JVM does not support
 hard (in VM) tail call optimisation, whereas the IBM JVM does support it
 where possible. There is ongoing discussion as to whether or not Java 8
 will support it. I assumed tail call optimisation was universal - it's not
 hard to implement, for example little virtual machine I wrote for my
 Greener Threads talk at CFOANZ included tail call optimisation for a simple
 subset of cfscript. Apparently the java permission mechanism and the need
 to include a stack trace in exceptions have prevented it to date.

 I do not know off hand if ColdFusion or Railo support any soft tail call
 optimisation when compiling CFML to byte code.

 Thanks,
 Robin




 Robin Hilliard
 Chief Technology Officer


 RocketBoots Pty Ltd
 Level 11
 189 Kent Street
 Sydney NSW 2001
 Australia map http://goo.gl/maps/RKyY9
 Phone +61 2 9323 2507
 Facsimile +61 2 9323 2501
 Mobile +61 418 414 341
 email ro...@rocketboots.com
 web www.rocketboots.com.au




  --
 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.






-- 
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.


rb_logo.png

[cfaussie] String Manipulation

2013-07-10 Thread raiola
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

 

logo_new

 

TrackingCentral Pty Ltd (A.C.N. 150 409 180)

Web: www.TrackingCentral.com.au http://www.trackingcentral.com.au/ 

Email: i...@trackingcentral.com.au

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.


image001.gif

Re: [cfaussie] String Manipulation

2013-07-10 Thread Paul Kukiel
cfset strArray = listToArray(1Z0617756740260660,) /
cfset newStr = '' /
cfloop from=1 to=#arrayLen(strArray)# index=i
  cfset newStr = listAppend(newStr,strArray[i],: ) /
/cfloop

cfdump var=#newStr# /

Will do it.


On Thu, Jul 11, 2013 at 12:28 AM, 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: i...@trackingcentral.com.au

 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.






-- 
Paul Kukiel

-- 
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.


image001.gif

Re: [cfaussie] String Manipulation

2013-07-10 Thread Paul Kukiel
I forgot that it's every 2:

cfset strArray = listToArray(1Z0617756740260660,) /
cfset newStr = '' /
cfloop from=1 to=#arrayLen(strArray)# index=i step=2
   cfset newStr = listAppend(newStr,strArray[i]strArray[i+1],: ) /
/cfloop


cfdump var=#newStr# /


On Thu, Jul 11, 2013 at 7:22 AM, Paul Kukiel kuki...@gmail.com wrote:

 cfset strArray = listToArray(1Z0617756740260660,) /
 cfset newStr = '' /
 cfloop from=1 to=#arrayLen(strArray)# index=i
   cfset newStr = listAppend(newStr,strArray[i],: ) /
 /cfloop

 cfdump var=#newStr# /

 Will do it.


 On Thu, Jul 11, 2013 at 12:28 AM, 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: i...@trackingcentral.com.au

 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.






 --
 Paul Kukiel




-- 
Paul Kukiel

-- 
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.


image001.gif

Re: [cfaussie] String Manipulation

2013-07-10 Thread Robin Hilliard
Or perhaps fp-style:

function colonise(s, out=) {
return (s eq ) ? out : colonise(mid(s, 3), listAppend(out, left(s, 
2), :));
}

writeOutput(colonise(1Z0617756740260660));

Cheers,
Robin

 


Robin Hilliard
Chief Technology Officer


RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australia   map
Phone   +61 2 9323 2507
Facsimile   +61 2 9323 2501
Mobile  +61 418 414 341
email   ro...@rocketboots.com
web www.rocketboots.com.au









On 11/07/2013, at 12:28 AM, 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
  
 image001.gif
  
 TrackingCentral Pty Ltd (A.C.N. 150 409 180)
 Web: www.TrackingCentral.com.au
 Email: i...@trackingcentral.com.au
 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.

-- 
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.


inline: rb_logo.png

RE: [cfaussie] String Manipulation

2013-07-10 Thread Dale Fraser
That looks very clever, I don't understand it so I tried to run it and work it 
out,

But it doesn't work for me.

Mid requires 3 params but you are passing 2, so not sure

Regards
Dale Fraser

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of 
Robin Hilliard
Sent: Thursday, 11 July 2013 11:26 AM
To: cfaussie@googlegroups.com
Subject: Re: [cfaussie] String Manipulation

Or perhaps fp-style:

function colonise(s, out=) {
return (s eq ) ? out : colonise(mid(s, 3), listAppend(out, left(s, 
2), :));
}

writeOutput(colonise(1Z0617756740260660));

Cheers,
Robin

 [cid:image001.png@01CE7E40.41DB2250]

Robin Hilliard
Chief Technology Officer


RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australiamaphttp://goo.gl/maps/RKyY9

Phone   +61 2 9323 2507
Facsimile   +61 2 9323 2501
Mobile   +61 418 414 341
email 
ro...@rocketboots.commailto:ro...@rocketboots.com
web  
www.rocketboots.com.auhttp://www.rocketboots.com.au/











On 11/07/2013, at 12:28 AM, rai...@ozemail.com.aumailto: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

image001.gif

TrackingCentral Pty Ltd (A.C.N. 150 409 180)
Web: www.TrackingCentral.com.auhttp://www.trackingcentral.com.au/
Email: i...@trackingcentral.com.aumailto:i...@trackingcentral.com.au
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.commailto:cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to 
cfaussie@googlegroups.commailto:cfaussie@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.commailto:cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to 
cfaussie@googlegroups.commailto:cfaussie@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/groups/opt_out.


-- 
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.


inline: image001.png

Re: [cfaussie] String Manipulation

2013-07-10 Thread Mark Mandel
There ya go:
cfscript
function colonise(s, out=) {
return (s eq ) ? out : colonise(mid(s, 3, Len(s)), listAppend(out,
left(s, 2), :));
 }

writeOutput(colonise(1Z0617756740260660));
/cfscript

Missed a len.

It just recursively runs through the string, taking two off the front of s
and putting them back on out until s eq .

Mark


On Thu, Jul 11, 2013 at 2:09 PM, Dale Fraser d...@fraser.id.au wrote:

  That looks very clever, I don’t understand it so I tried to run it and
 work it out,

 ** **

 But it doesn’t work for me.

 ** **

 Mid requires 3 params but you are passing 2, so not sure 

 ** **

 Regards

 Dale Fraser

 ** **

 *From:* cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] *On
 Behalf Of *Robin Hilliard
 *Sent:* Thursday, 11 July 2013 11:26 AM
 *To:* cfaussie@googlegroups.com
 *Subject:* Re: [cfaussie] String Manipulation

 ** **

 Or perhaps fp-style:

 ** **

 function colonise(s, out=) {

 return (s eq ) ? out : colonise(mid(s, 3), listAppend(out,
 left(s, 2), :));

 }

 ** **

 writeOutput(colonise(1Z0617756740260660));

 ** **

 Cheers,

 Robin

 ** **

  

 ** **

 Robin Hilliard

 Chief Technology Officer

 RocketBoots Pty Ltd

 Level 11

 189 Kent Street

 Sydney NSW 2001

 Australiamap http://goo.gl/maps/RKyY9

 Phone   +61 2 9323 2507

 Facsimile   +61 2 9323 2501

 Mobile   +61 418 414 341

 email ro...@rocketboots.com

 web  www.rocketboots.com.au

 ** **

 ** **

 ** **

 ** **

 ** **

 ** **




 

 ** **

 On 11/07/2013, at 12:28 AM, 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

  

 image001.gif

  

 TrackingCentral Pty Ltd (A.C.N. 150 409 180)

 Web: www.TrackingCentral.com.au http://www.trackingcentral.com.au/

 Email: i...@trackingcentral.com.au

 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.

  ** **

 --
 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.

  

 --
 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.






-- 
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.


image001.png

RE: [cfaussie] String Manipulation

2013-07-10 Thread Dale Fraser
Very nice,

I love recursive functions, just don't see them often, makes me think of a lot 
of other uses for them I've never considered.

Also nice that railo lets you get the rest of the string without specifying the 
length, seems like a logical thing to do.

Regards
Dale Fraser

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of 
Robin Hilliard
Sent: Thursday, 11 July 2013 2:41 PM
To: cfaussie@googlegroups.com
Subject: Re: [cfaussie] String Manipulation

Hi Dale,

Sorry I tested in Railo, it let me get away without the third argument. The 
arguments as the function calls itself look like this:

colonise(1Z0617756740260660,)
   colonise(0617756740260660,1Z)
  colonise(17756740260660,1Z:06)
 colonise(756740260660,1Z:06:17)
   ...

until the first argument is , at which point the first part of the ternary 
expression triggers and returns the second argument.

Cheers,
Robin


 [cid:image001.png@01CE7E45.6DFC5660]

Robin Hilliard
Chief Technology Officer


RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australiamaphttp://goo.gl/maps/RKyY9

Phone   +61 2 9323 2507
Facsimile   +61 2 9323 2501
Mobile   +61 418 414 341
email 
ro...@rocketboots.commailto:ro...@rocketboots.com
web  
www.rocketboots.com.auhttp://www.rocketboots.com.au/











On 11/07/2013, at 2:09 PM, Dale Fraser 
d...@fraser.id.aumailto:d...@fraser.id.au wrote:


That looks very clever, I don't understand it so I tried to run it and work it 
out,

But it doesn't work for me.

Mid requires 3 params but you are passing 2, so not sure

Regards
Dale Fraser

From: cfaussie@googlegroups.commailto:cfaussie@googlegroups.com 
[mailto:cfaussie@googlegroups.comhttp://googlegroups.com] On Behalf Of Robin 
Hilliard
Sent: Thursday, 11 July 2013 11:26 AM
To: cfaussie@googlegroups.commailto:cfaussie@googlegroups.com
Subject: Re: [cfaussie] String Manipulation

Or perhaps fp-style:

function colonise(s, out=) {
return (s eq ) ? out : colonise(mid(s, 3), listAppend(out, left(s, 
2), :));
}

writeOutput(colonise(1Z0617756740260660));

Cheers,
Robin

 image001.png

Robin Hilliard
Chief Technology Officer


RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australiamaphttp://goo.gl/maps/RKyY9
Phone   +61 2 9323 2507
Facsimile   +61 2 9323 2501
Mobile   +61 418 414 341
email 
ro...@rocketboots.commailto:ro...@rocketboots.com
web  
www.rocketboots.com.auhttp://www.rocketboots.com.au/











On 11/07/2013, at 12:28 AM, rai...@ozemail.com.aumailto: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

image001.gif

TrackingCentral Pty Ltd (A.C.N. 150 409 180)
Web: www.TrackingCentral.com.auhttp://www.trackingcentral.com.au/
Email: i...@trackingcentral.com.aumailto:i...@trackingcentral.com.au
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.commailto:cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to 
cfaussie@googlegroups.commailto:cfaussie@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.commailto:cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to 
cfaussie@googlegroups.commailto:cfaussie@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/groups/opt_out.



--
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.commailto:cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to 
cfaussie@googlegroups.commailto:cfaussie@googlegroups.com.
Visit this group at http://groups.google.com/group/cfaussie.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.commailto:cfaussie+unsubscr...@googlegroups.com.
To post to this group, send email to 
cfaussie@googlegroups.commailto:cfaussie

Re: [cfaussie] String Manipulation

2013-07-10 Thread Robin Hilliard

On 11/07/2013, at 2:47 PM, Dale Fraser d...@fraser.id.au wrote:

 I love recursive functions, just don’t see them often, makes me think of a 
 lot of other uses for them I’ve never considered.

Cool, inspiration is good :-). This is a classic functional programming 
approach - start with the result (an empty input and a completed output) then 
work out the step-wise process to get there from the input.

I should point out that because the recursion is on the last line of the 
function this is tail recursive - the compiler will notice this and optimise 
the code by throwing away the current stack frame (which would have been used 
by later statements in the function had they existed) each time the recursive 
call is made, so you don't need to worry about a stack overflow - this is how 
functional languages iterate efficiently.

Cheers,
Robin


 


Robin Hilliard
Chief Technology Officer


RocketBoots Pty Ltd
Level 11
189 Kent Street
Sydney NSW 2001
Australia   map
Phone   +61 2 9323 2507
Facsimile   +61 2 9323 2501
Mobile  +61 418 414 341
email   ro...@rocketboots.com
web www.rocketboots.com.au










-- 
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.


inline: rb_logo.png

RE: [cfaussie] string manipulation to find the value in a comma separated value record set of a specific length and syntax

2013-07-07 Thread raiola
Hi Charlie

 

I trust the following will clear up any confusion

 

I have data from mobile devices being sent to my server

 

The listener captures the packet as a record in database table and the
content of the packet is stored in a column the database table. This table
become my raw data / log table of all incoming data

 

I then need to run a process to determine the value of the imei number that
is included in each packet of data (the packet data is csv string format),
the imei number tells me which device the data has been sent from.

 

The issue is that different packets received from different devices have
their imei number located in different positions within the packet data
being sent

 

Given each imei number is of a set length ( 15 characters ) and only
contains numeric characters of 0-9 I am trying to determine the best way to
find the value of the imei number in each packet received given the position
in the string will not always be at the same location within the string 

 

 

 

 

Kind Regards

 

Claude Raiola

SAMARIS Software

Call 1300 255 990

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf
Of Charlie Arehart
Sent: Friday, 5 July 2013 8:44 AM
To: cfaussie@googlegroups.com
Subject: RE: [cfaussie] string manipulation to find the value in a comma
separated value record set of a specific length and syntax

 

Claude, you don't mention how you are reading the csv in, in the first
place. Are you using CFFILE or another function to read the entire file in,
and then trying to loop over it?

Have you instead tried using CFHTTP? Many don't know it but that has long
had the ability to read in a CSV and convert it to a query (created using
the NAME attribute). Once done, you can easily access the rows and columns,
including using SQL to do a query of queries, to do filtering or other
manipulation. (If you already know of this use of CFHTTP, had you had any
luck in using Q of Q to do the manipulation you seek?)

The only challenge with using CFHTTP for this is that the CSV file in
question does need to be in a web-accessible directory, as you still have to
use a URL to point to the CSV. But if that's not an issue or can be
resolved, you may be surprised the power if you've never seen/used it. 

The tag has a few attributes to control things like whether the first line
has a header row, what delimiter and qualifier to use (if other than a comma
and double-quotes), and more.


The feature is documented in Developer's guide:

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172
e0811cbec1529c-7fff.html

While it's mentioned in the CFML Reference page for CFHTTP, curiously the
key attributes for this capability are not mentioned in the initial table of
attributes (as seems more typical). Instead, they are listed in a separate
table down the page (search for the text, convert the HTTP response body
into a ColdFusion query object, as there is no section header for it):

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e08
11cbec22c24-7ffc.html

Finally, here's an example that shows both reading a CSV and processing it
with Q of Q (it's listed oddly in a section on using the Cast function for Q
of Q):

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172
e0811cbec0e4fd-7ff0.html#WSc3ff6d0ea77859461172e0811cbec22c24-7b7b

Hope that helps someone, even if not you, Claude. But if it does not, what
aspect still fails to be resolved? It wasn't quite clear from your note (or
your subsequent replies to others here).

/charlie

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf
Of rai...@ozemail.com.au
Sent: Thursday, July 04, 2013 9:35 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] string manipulation to find the value in a comma
separated value record set of a specific length and syntax

 

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.471
336,20130704121354,0505,0002,1B8D,A281,00,006064939682,-66,20130704122355,07
58$'

 

record 2: '+RESP:GTTRI,
868487001009190,1,0,0,0,0.2,148,6.4,3,153.034551,-27.471390,20130610110953,0
505,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

RE: [cfaussie] string manipulation to find the value in a comma separated value record set of a specific length and syntax

2013-07-07 Thread raiola
Thank Paul

 

I have it sorted

 

Its possibly not the cleanest way but it works

 

cfset imei_pos = reFindNoCase([0-9]{15}, raw)

cfset before_imei =left(raw,imei_pos)

cfset comma_count = listlen(before_imei) 

cfset imei = ListGetAt(raw,comma_count,,)

 

 

 

Kind Regards

 

Claude Raiola

SAMARIS Software

Call 1300 255 990

 

From: Paul Kukiel [mailto:kuki...@gmail.com] 
Sent: Sunday, 7 July 2013 6:35 PM
To: rai...@ozemail.com.au
Subject: Re: [cfaussie] string manipulation to find the value in a comma 
separated value record set of a specific length and syntax

 

If you send me a few samples perhaps I can help?

Paul Kukiel | CTO

IMG Sports Technology Group

600 Victoria Street

Richmond 3121

Victoria Australia

P +61 3 9426 2600

M +61 (0) 403 218 804

pkuk...@imgstg.com

http://www.imgstg.com


On 07/07/2013, at 4:09 PM, rai...@ozemail.com.au wrote:

Hi Charlie

 

I trust the following will clear up any confusion

 

I have data from mobile devices being sent to my server

 

The listener captures the packet as a record in database table and the content 
of the packet is stored in a column the database table. This table become my 
raw data / log table of all incoming data

 

I then need to run a process to determine the value of the imei number that is 
included in each packet of data (the packet data is csv string format), the 
imei number tells me which device the data has been sent from.

 

The issue is that different packets received from different devices have their 
imei number located in different positions within the packet data being sent

 

Given each imei number is of a set length ( 15 characters ) and only contains 
numeric characters of 0-9 I am trying to determine the best way to find the 
value of the imei number in each packet received given the position in the 
string will not always be at the same location within the string 

 

 

 

 

Kind Regards

 

Claude Raiola

SAMARIS Software

Call 1300 255 990

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of 
Charlie Arehart
Sent: Friday, 5 July 2013 8:44 AM
To: cfaussie@googlegroups.com
Subject: RE: [cfaussie] string manipulation to find the value in a comma 
separated value record set of a specific length and syntax

 

Claude, you don’t mention how you are reading the csv in, in the first place. 
Are you using CFFILE or another function to read the entire file in, and then 
trying to loop over it?

Have you instead tried using CFHTTP? Many don’t know it but that has long had 
the ability to read in a CSV and convert it to a query (created using the NAME 
attribute). Once done, you can easily access the rows and columns, including 
using SQL to do a query of queries, to do filtering or other manipulation. (If 
you already know of this use of CFHTTP, had you had any luck in using Q of Q to 
do the manipulation you seek?)

The only challenge with using CFHTTP for this is that the CSV file in question 
does need to be in a web-accessible directory, as you still have to use a URL 
to point to the CSV. But if that’s not an issue or can be resolved, you may be 
surprised the power if you’ve never seen/used it. 

The tag has a few attributes to control things like whether the first line has 
a header row, what delimiter and qualifier to use (if other than a comma and 
double-quotes), and more.


The feature is documented in Developer’s guide:

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec1529c-7fff.html

While it’s mentioned in the CFML Reference page for CFHTTP, curiously the key 
attributes for this capability are not mentioned in the initial table of 
attributes (as seems more typical). Instead, they are listed in a separate 
table down the page (search for the text, “convert the HTTP response body into 
a ColdFusion query object”, as there is no section header for it):

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7ffc.html

Finally, here’s an example that shows both reading a CSV and processing it with 
Q of Q (it’s listed oddly in a section on using the Cast function for Q of Q):

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec0e4fd-7ff0.html#WSc3ff6d0ea77859461172e0811cbec22c24-7b7b

Hope that helps someone, even if not you, Claude. But if it does not, what 
aspect still fails to be resolved? It wasn’t quite clear from your note (or 
your subsequent replies to others here).

/charlie

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf Of 
rai...@ozemail.com.au
Sent: Thursday, July 04, 2013 9:35 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] string manipulation to find the value in a comma separated 
value record set of a specific length and syntax

 

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

[cfaussie] string manipulation to find the value in a comma separated value record set of a specific length and syntax

2013-07-04 Thread raiola
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.471
336,20130704121354,0505,0002,1B8D,A281,00,006064939682,-66,20130704122355,07
58$'

 

record 2: '+RESP:GTTRI,
868487001009190,1,0,0,0,0.2,148,6.4,3,153.034551,-27.471390,20130610110953,0
505,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.




Re: [cfaussie] string manipulation to find the value in a comma separated value record set of a specific length and syntax

2013-07-04 Thread M@ Bourke
ListFindNoCase()  ??

On Thu, Jul 4, 2013 at 2:35 PM, 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.




-- 
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] string manipulation to find the value in a comma separated value record set of a specific length and syntax

2013-07-04 Thread raiola
Hi 

 

I think you misunderstand I will not know what the values of the 15
character numbers are, that's the objective finding the 15 character numbers
to the ne able to determine what the actual number value is which will be
different for each record

 

 

 

Kind Regards

 

Claude Raiola

SAMARIS Software

Call 1300 255 990

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf
Of M@ Bourke
Sent: Friday, 5 July 2013 12:03 AM
To: cfaussie@googlegroups.com
Subject: Re: [cfaussie] string manipulation to find the value in a comma
separated value record set of a specific length and syntax

 

ListFindNoCase()  ??

On Thu, Jul 4, 2013 at 2:35 PM, 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.471
336,20130704121354,0505,0002,1B8D,A281,00,006064939682,-66,20130704122355,07
58$'

 

record 2: '+RESP:GTTRI,
868487001009190,1,0,0,0,0.2,148,6.4,3,153.034551,-27.471390,20130610110953,0
505,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
mailto:cfaussie%2bunsubscr...@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.
 
 

 

-- 
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.
 
 

-- 
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] string manipulation to find the value in a comma separated value record set of a specific length and syntax

2013-07-04 Thread M@ Bourke
then you want a regex like
[0-9]{15}

it'll find a number set 15 numbers long.

Do I understand you better now?
reFindNoCase
should return
868487001009190
then if you want to know the position you could do a listFindNoCase
pseudo code

foundNumber = reFindNoCase([0-9]{15}, bigString)
position = listFindNoCase(foundNumber , bigString)

these function params could be in the wrong order etc, but is this kind of
what you mean?


On Thu, Jul 4, 2013 at 3:13 PM, rai...@ozemail.com.au wrote:

  *Hi *

 * *

 *I think you misunderstand I will not know what the values of the 15
 character numbers are, that’s the objective finding the 15 character
 numbers to the ne able to determine what the actual number value is which
 will be different for each record*

 * *

 ** **

 ** **

 Kind Regards

 ** **

 Claude Raiola

 SAMARIS Software

 Call 1300 255 990

 * *

 *From:* cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] *On
 Behalf Of *M@ Bourke
 *Sent:* Friday, 5 July 2013 12:03 AM
 *To:* cfaussie@googlegroups.com
 *Subject:* Re: [cfaussie] string manipulation to find the value in a
 comma separated value record set of a specific length and syntax

 ** **

 ListFindNoCase()  ??

 On Thu, Jul 4, 2013 at 2:35 PM, 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.

  

 ** **

 --
 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.

  

 --
 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.




-- 
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] string manipulation to find the value in a comma separated value record set of a specific length and syntax

2013-07-04 Thread Chris Velevitch
I understand you want to know the column in the record, then do a
ListToArray and loop though each element to look for the pattern, use
^[0-9]{15}$ to look for value that are exactly 15 chars.

Chris
--
Chris Velevitch
Manager - Adobe Platform Users Group, Sydney
m: 0415 469 095
www.apugs.org.au

Adobe Platform Users Group, Sydney
Topic: TBD
Date: Monday, 29th July
Details and RSVP on http://www.meetup.com/Sydney-Adobe-Platform-User-Group

-- 
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] string manipulation to find the value in a comma separated value record set of a specific length and syntax

2013-07-04 Thread Gavin Baumanis
I realise it is not - in your example but...
If the position of the number s always at the same position in the list;
You can use ListGetAt()

Otherwise you can loop through the list using the regex of the other posts 
to find your match.

Lastly, depending on the length of the CSV, and the lists themselves, you 
don't need to convert to an array first.
There are appropriate functions available to let you process thee data in 
list form.

Array manipulation / searching is faster, though - so I normally convert to 
an Array.
(The speed test also takes into account the transformation from list to 
array and then back again - so it shows there is significant speed gains in 
using Arrays.)

Ultimately, it just depends on how comfortable you are with converting 
between lists to arrays and back again.

Gavin. 

-- 
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] string manipulation to find the value in a comma separated value record set of a specific length and syntax

2013-07-04 Thread Charlie Arehart
Claude, you don't mention how you are reading the csv in, in the first
place. Are you using CFFILE or another function to read the entire file in,
and then trying to loop over it?

Have you instead tried using CFHTTP? Many don't know it but that has long
had the ability to read in a CSV and convert it to a query (created using
the NAME attribute). Once done, you can easily access the rows and columns,
including using SQL to do a query of queries, to do filtering or other
manipulation. (If you already know of this use of CFHTTP, had you had any
luck in using Q of Q to do the manipulation you seek?)

The only challenge with using CFHTTP for this is that the CSV file in
question does need to be in a web-accessible directory, as you still have to
use a URL to point to the CSV. But if that's not an issue or can be
resolved, you may be surprised the power if you've never seen/used it. 

The tag has a few attributes to control things like whether the first line
has a header row, what delimiter and qualifier to use (if other than a comma
and double-quotes), and more.


The feature is documented in Developer's guide:

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172
e0811cbec1529c-7fff.html

While it's mentioned in the CFML Reference page for CFHTTP, curiously the
key attributes for this capability are not mentioned in the initial table of
attributes (as seems more typical). Instead, they are listed in a separate
table down the page (search for the text, convert the HTTP response body
into a ColdFusion query object, as there is no section header for it):

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e08
11cbec22c24-7ffc.html

Finally, here's an example that shows both reading a CSV and processing it
with Q of Q (it's listed oddly in a section on using the Cast function for Q
of Q):

http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172
e0811cbec0e4fd-7ff0.html#WSc3ff6d0ea77859461172e0811cbec22c24-7b7b

Hope that helps someone, even if not you, Claude. But if it does not, what
aspect still fails to be resolved? It wasn't quite clear from your note (or
your subsequent replies to others here).

/charlie

 

From: cfaussie@googlegroups.com [mailto:cfaussie@googlegroups.com] On Behalf
Of rai...@ozemail.com.au
Sent: Thursday, July 04, 2013 9:35 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] string manipulation to find the value in a comma
separated value record set of a specific length and syntax

 

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.471
336,20130704121354,0505,0002,1B8D,A281,00,006064939682,-66,20130704122355,07
58$'

 

record 2: '+RESP:GTTRI,
868487001009190,1,0,0,0,0.2,148,6.4,3,153.034551,-27.471390,20130610110953,0
505,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.
 
 

-- 
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] String Manipulation

2008-02-03 Thread Claude Raiola


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' <[EMAIL PROTECTED]>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




 ---

 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  -~--~~~~--~~--~--~---