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
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
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,
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
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
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
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
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
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
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
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
: 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
: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
13 matches
Mail list logo