Re: Replacing Characters

2014-09-30 Thread Bob Sneidar
Use repeat with i - 1 to the number of characters of myString step 3 Bob S On Sep 27, 2014, at 24:23 , JB sund...@pacifier.com wrote: Another thing to consider is the characters are not in any specific crder. It could be cfacded or anything else. If is use a repeat for each char and the

Re: Replacing Characters

2014-09-30 Thread JB
Thanks! John Balgenorth On Sep 30, 2014, at 4:12 PM, Bob Sneidar bobsnei...@iotecdigital.com wrote: Use repeat with i - 1 to the number of characters of myString step 3 Bob S On Sep 27, 2014, at 24:23 , JB sund...@pacifier.com wrote: Another thing to consider is the characters are

Re: Replacing Characters

2014-09-29 Thread JB
The code I posted is not accurate. For one thing it should have been put 71 into i because the return will make the 72 char in the line. Another problem is it does not end with the last line being 72 chars or less. Anyway this is a start to the fix. John Balgenorth On Sep 28, 2014, at 3:44 PM,

Re: Replacing Characters

2014-09-29 Thread JB
Instead of my goofy repeat command your replace can be modified to some thing like the code below. command replace_maybe @rString repeat with i = 58 to length( rString ) step 58 put return after char i of rString end repeat end replace_maybe But the problem is similar to what

Re: Replacing Characters

2014-09-28 Thread JB
Hi Dick, I found the char was getting off by 1 each line because of the EOL returns. Here is a regex to strip the EOL returns. put replacetext(theData,[\0\cM\r\f\n],) into theData and then here is some code to put the EOL returns back. put theData into tString --put fld id 1022

Re: Replacing Characters

2014-09-27 Thread Kay C Lan
Assuming tBigList contains your data and it is a tab separated list. set the itemDelimiter to tab repeat for each item tSearchThis in tBigList if (char 3 of tSearchThis = D) then put + into char 3 of tSearchThis end if put tSearchThis tab after tNewList end repeat --remove the trailing tab

Re: Replacing Characters

2014-09-27 Thread JB
Thanks, Kay! The problem is there are no delimiters. It is a string of only chars A to F and there are no spaces etc. John Balgenorth On Sep 26, 2014, at 11:19 PM, Kay C Lan lan.kc.macm...@gmail.com wrote: Assuming tBigList contains your data and it is a tab separated list. set the

Re: Replacing Characters

2014-09-27 Thread JB
Another thing to consider is the characters are not in any specific crder. It could be cfacded or anything else. If is use a repeat for each char and the variable as a counter that resets every three times then I only need to make one pass through to make the changes. But there might be a

Re: Replacing Characters

2014-09-27 Thread Dick Kriesel
On Sep 27, 2014, at 12:23 AM, JB sund...@pacifier.com wrote: But there might be a faster way. Hi, John. Here's a way that works in under a millisecond on my iMac, and a way to test its speed. command replace_maybe @rString repeat with i = 3 to length( rString ) step 3 if char i

Re: Replacing Characters

2014-09-27 Thread JB
Hi Dick, That is really nice! Thank you. It works great. John Balgenorth On Sep 27, 2014, at 1:49 AM, Dick Kriesel dick.krie...@mail.com wrote: On Sep 27, 2014, at 12:23 AM, JB sund...@pacifier.com wrote: But there might be a faster way. Hi, John. Here's a way that works in under a

Replacing Characters

2014-09-26 Thread JB
I want to replace every third character in a text string if it is a certain character. So lets say I have a list of characters there range from A thru F and the list is possibly 10,000 characters long. I want to check every third character in the list and if it is a D then I want to change it to

Re: Replacing Characters

2014-09-26 Thread larry
: Replacing Characters I want to replace every third character in a text string if it is a certain character. So lets say I have a list of characters there range from A thru F and the list is possibly 10,000 characters long. I want to check every third character in the list and if it is a D then I want

Re: Replacing Characters

2014-09-26 Thread JB
:26 PM Subject: Replacing Characters I want to replace every third character in a text string if it is a certain character. So lets say I have a list of characters there range from A thru F and the list is possibly 10,000 characters long. I want to check every third character