Re: delete end chars

2014-08-25 Thread JB
You brought a lot to the table. Test code is nice ti have and I thank you for it. I was thinking Peter’s would be faster and I wanted to use it. I got it working in a new stack with the code the others wrote and saved it all. They akk work in the new stack but don’t work properly in the stack t

Re: delete end chars

2014-08-24 Thread Peter Haworth
On Sun, Aug 24, 2014 at 8:09 PM, Kay C Lan wrote: > Not bringing much to the table other than to say that if you are > looking into large amounts of data, and need to do this millions of > time, and therefore speed is of interest, Peter's grep solution is > ever so slightly faster than Colin's. T

Re: delete end chars

2014-08-24 Thread Kay C Lan
Not bringing much to the table other than to say that if you are looking into large amounts of data, and need to do this millions of time, and therefore speed is of interest, Peter's grep solution is ever so slightly faster than Colin's. There isn't much in it and both scale well. If you'd like to

Re: delete end chars

2014-08-24 Thread JB
You are right. Thank you! What happened is the variables were all listed right in my code for the searching and replacing and then I put the wrong variable into the field I wanted to change. thanks again. John Balgenorth On Aug 24, 2014, at 3:07 PM, Peter Haworth wrote: > On Sun, Aug 24, 20

Re: delete end chars

2014-08-24 Thread Peter Haworth
On Sun, Aug 24, 2014 at 1:43 PM, JB wrote: > I still can’t get it to work for some reason. And the > first regex one ends up leaving me the letters that > I wanted to delete instead of leaving the other part. > Strange. They both work fine here. Maybe the variables are the wrong way round? t

Re: delete end chars

2014-08-24 Thread JB
I still can’t get it to work for some reason. And the first regex one ends up leaving me the letters that I wanted to delete instead of leaving the other part. After getting the others to work in a new stack I tried them in the script I needed it for and the only one that would work is the one Co

Re: delete end chars

2014-08-24 Thread Peter Haworth
On Sun, Aug 24, 2014 at 10:35 AM, JB wrote: > (tString1,"(.*)" & tString2 & "$",tString1,tStart,tEnd) My apologies, should have tested it first! It should be: if matchChunk(tString1,".*(" & tString2 & ")$",tStart,tEnd) then delete char tStart to tEnd of tString1 end if Pete lcSQL Software

Re: delete end chars

2014-08-24 Thread JB
Thank you very much! I was able to get the first one to work but for some reason and it could be me I could not get the second one to work. thanks again John Balgenorth On Aug 24, 2014, at 10:19 AM, Peter Haworth wrote: > Couple of other ways using regex. > > get matchText(tString1,"(.*)" &

Re: delete end chars

2014-08-24 Thread Peter Haworth
Couple of other ways using regex. get matchText(tString1,"(.*)" & tString2 & "$",tString1) Or if matchChunk(tString1,"(.*)" & tString2 & "$",tString1,tStart,tEnd) then delete char tStart to tEnd of tString1 end if Pete lcSQL Software Home of lcStackBrowser

Re: delete end chars

2014-08-24 Thread JB
I got that one to work. Thank you. John Balgenorth On Aug 24, 2014, at 9:42 AM, Scott Rossi wrote: > Pete beat me to the punch. > > if text of fld 1 ends with text of fld 2 then \ > delete char -(length(fld 2)) to -1 of fld 1 > > > Regards, > > Scott Rossi > Creative Director > Tactil

Re: delete end chars

2014-08-24 Thread JB
Thank you for the reply and code. I can’t seem to get it to work right. The only thing I could make it do is if ABC is string1 and ABC us string2 it will delete string2 but if chars are before the ABC in string2 nothing is deleted. Even so it is good code and I might need to use it sometime. Joh

Re: delete end chars

2014-08-24 Thread Scott Rossi
Pete beat me to the punch. if text of fld 1 ends with text of fld 2 then \ delete char -(length(fld 2)) to -1 of fld 1 Regards, Scott Rossi Creative Director Tactile Media, UX/UI Design On 8/24/14 9:28 AM, "Peter Haworth" wrote: >if tString1 ends with tString2 then > delete char (t

Re: delete end chars

2014-08-24 Thread Peter Haworth
if tString1 ends with tString2 then delete char (the length of tString1 - the length of tString2 +1 ) to -1 of tString1 end if Pete lcSQL Software Home of lcStackBrowser and SQLiteAdmin O

Re: delete end chars

2014-08-24 Thread JB
Thank you very much! John Balgenorth On Aug 24, 2014, at 9:01 AM, Richmond wrote: > On 24/08/14 18:54, JB wrote: >> Hi Richmond, >> >> That seems to leave me with the string I want to delete. >> Even so thank you for the code. >> >> John Balgenorth >> >> >> On Aug 24, 2014, at 8:46 AM, Ric

Re: delete end chars

2014-08-24 Thread Colin Holgate
Another problem with this approach is that there may be other cases where the letters are in the string, and have a cr after them. All of the cases would be removed, not just the last one. On Aug 24, 2014, at 11:38 AM, Peter M. Brigham wrote: > function zapAtEndOfLine tStr, tContainer > put

Re: delete end chars

2014-08-24 Thread Richmond
On 24/08/14 18:54, JB wrote: Hi Richmond, That seems to leave me with the string I want to delete. Even so thank you for the code. John Balgenorth On Aug 24, 2014, at 8:46 AM, Richmond wrote: on mouseUp put fld "TEXXT" into TEXXT put the number of chars in TEXXT into CHNMB repeat

Re: delete end chars

2014-08-24 Thread JB
Hi Richmond, That seems to leave me with the string I want to delete. Even so thank you for the code. John Balgenorth On Aug 24, 2014, at 8:46 AM, Richmond wrote: > on mouseUp > put fld "TEXXT" into TEXXT > put the number of chars in TEXXT into CHNMB > repeat CHNMB times > if the l

Re: delete end chars

2014-08-24 Thread Richmond
On 24/08/14 18:48, Colin Holgate wrote: What if the field happen to already end with a cr? On Aug 24, 2014, at 11:38 AM, Peter M. Brigham wrote: function zapAtEndOfLine tStr, tContainer put cr after tContainer replace tStr & cr with cr in tContainer return char 1 to -2 of tContainer

Re: delete end chars

2014-08-24 Thread JB
That works really good too! thank you, John Balgenorth On Aug 24, 2014, at 8:38 AM, Peter M. Brigham wrote: > function zapAtEndOfLine tStr, tContainer > put cr after tContainer > replace tStr & cr with cr in tContainer > return char 1 to -2 of tContainer > end zapAtEndOfLine > > -- Pete

Re: delete end chars

2014-08-24 Thread Colin Holgate
What if the field happen to already end with a cr? On Aug 24, 2014, at 11:38 AM, Peter M. Brigham wrote: > function zapAtEndOfLine tStr, tContainer > put cr after tContainer > replace tStr & cr with cr in tContainer > return char 1 to -2 of tContainer > end zapAtEndOfLine ___

Re: delete end chars

2014-08-24 Thread Richmond
On 24/08/14 18:19, JB wrote: Hi Richmond, Wouldn’t that just delete the last char? I need to check for all characters in the first string to see if they all exist in the same order of the last chars of the second string. I know I could use a repeat to see if the characters all exist and then i

Re: delete end chars

2014-08-24 Thread Peter M. Brigham
function zapAtEndOfLine tStr, tContainer put cr after tContainer replace tStr & cr with cr in tContainer return char 1 to -2 of tContainer end zapAtEndOfLine -- Peter Peter M. Brigham pmb...@gmail.com http://home.comcast.net/~pmbrig On Aug 24, 2014, at 11:12 AM, JB wrote: > Hi, > > T

Re: delete end chars

2014-08-24 Thread JB
That works good! thank you, John Balgenorth On Aug 24, 2014, at 8:21 AM, Colin Holgate wrote: > on mouseUp > put fld 1 into f1 > put fld 2 into f2 > put offset(f1,f2) into offamount > if offamount = the number of chars in f2 - the number of chars in f1 + 1 > then > put char 1 to

Re: delete end chars

2014-08-24 Thread JB
Hi Richmond, Wouldn’t that just delete the last char? I need to check for all characters in the first string to see if they all exist in the same order of the last chars of the second string. I know I could use a repeat to see if the characters all exist and then if they do I could use a repeat

Re: delete end chars

2014-08-24 Thread Colin Holgate
This seems to work (where you have field one with the letters to check, and field 2 is the letters that might end with those check letters): on mouseUp put fld 1 into f1 put fld 2 into f2 put offset(f1,f2) into offamount if offamount = the number of chars in f2 - the number of chars i

Re: delete end chars

2014-08-24 Thread JB
Hi, Thanks for the reply. I am saying if I have “ABC” in one string and the other string has “KCFAJFCABC” then I want to delete the “ABC” from the end of the second string leaving “KCFAJFC”. John Balgenorth On Aug 24, 2014, at 8:09 AM, dunb...@aol.com wrote: > Hi. > > > Are you saying that

Re: delete end chars

2014-08-24 Thread Richmond
On 24/08/14 17:12, JB wrote: If I have a certain amount of characters and I want to check the end of another line of characters to see if they are there and if so then delete them what is the fastest way to do delete the characters at the end of the specified line? delete last char of XYZ [wh

Re: delete end chars

2014-08-24 Thread dunbarx
Hi. Are you saying that if you have "ABCD" and somewhere else you have: "AXFRZC" that you want to delete the "C" from the first string? Whatever you want, the chunking and text control within LC is more than adequate to do the job, and will be fun do execute as well. But is this what you mea