Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Macro for detect and list palindromes and repeats in letters/numbersstring

Dear all,
I am looking to detect palindromes (sentence or number or other
sequence of units that can be read the same way in either direction)
and repeats (sequences of letters or numbers which are repeating at
least twice within a string) in some strings containing between
20-5000 letters. Has somebody any idea how could I perform that using
an Excel macro? I would like that the string to be evaluated could be
on cell "A1" and that the detected palindromes and repeats could be
listed bellow A2 and C2, respectively; and that the number of times
that they appear in the sentence could be listed bellow cells B2 and
D2, respectively, as the following small example:

QGAGGAAGGAGQ
Palindromes Number Repeats Number
QGAGGAAGGAGQ 1 GA 3
GAG 2 AG 3
GG 2 GAG 2
AA 1 AA 1
GG 2

Somebody could help me?
Thanks in advance,
Luciano
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Macro for detect and list palindromes and repeats in letters/numbers string

What is the "rule" for forming the included (smaller) palindromes? For
example, why isn't AA, GAAG, GGAAGG, etc. considered included palindromes?
Is the rule "only from one of the mirrored sides"? If so, why do you count
the "repeats" from either of the mirrored sides?

--
Rick (MVP - Excel)


"Luciano Paulino da Silva" wrote in message
...
Dear all,
I am looking to detect palindromes (sentence or number or other
sequence of units that can be read the same way in either direction)
and repeats (sequences of letters or numbers which are repeating at
least twice within a string) in some strings containing between
20-5000 letters. Has somebody any idea how could I perform that using
an Excel macro? I would like that the string to be evaluated could be
on cell "A1" and that the detected palindromes and repeats could be
listed bellow A2 and C2, respectively; and that the number of times
that they appear in the sentence could be listed bellow cells B2 and
D2, respectively, as the following small example:

QGAGGAAGGAGQ
Palindromes Number Repeats Number
QGAGGAAGGAGQ 1 GA 3
GAG 2 AG 3
GG 2 GAG 2
AA 1 AA 1
GG 2

Somebody could help me?
Thanks in advance,
Luciano


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Macro for detect and list palindromes and repeats in letters/numbe

There is no need to post this multiple times. If someone can help, they'll
answer the other question.

"Luciano Paulino da Silva" wrote:

Dear all,
I am looking to detect palindromes (sentence or number or other
sequence of units that can be read the same way in either direction)
and repeats (sequences of letters or numbers which are repeating at
least twice within a string) in some strings containing between
20-5000 letters. Has somebody any idea how could I perform that using
an Excel macro? I would like that the string to be evaluated could be
on cell "A1" and that the detected palindromes and repeats could be
listed bellow A2 and C2, respectively; and that the number of times
that they appear in the sentence could be listed bellow cells B2 and
D2, respectively, as the following small example:

QGAGGAAGGAGQ
Palindromes Number Repeats Number
QGAGGAAGGAGQ 1 GA 3
GAG 2 AG 3
GG 2 GAG 2
AA 1 AA 1
GG 2

Somebody could help me?
Thanks in advance,
Luciano

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Macro for detect and list palindromes and repeats inletters/numbers string

Thank you very much Rick.
In fact, I forgot to talk about that. You are right, and I forgot some
of the potential palindromes, including AA, GAAG and GGAAGG. I needs
of all palindromes that could be generated for a given string. In some
case, they will be subsequences of other palindromes. It is necessary
include palindromes from 2 to any size. For palindromes it is
necessary only count them from one mirroed side since the other side
will be identical.
The repeats will be characterized by any sequence (from 2 to any size)
that appear at least 2 times in the string. In fact, AA is not a
repeat, since it appeared only one time.
Thank you for your observations,
Luciano

On 14 abr, 13:14, "Rick Rothstein"
wrote:
What is the "rule" for forming the included (smaller) palindromes? For
example, why isn't AA, GAAG, GGAAGG, etc. considered included palindromes?
Is the rule "only from one of the mirrored sides"? If so, why do you count
the "repeats" from either of the mirrored sides?

--
Rick (MVP - Excel)

"Luciano Paulino da Silva" wrote in ...

Dear all,
I am looking to detect palindromes (sentence or number or other
sequence of units that can be read the same way in either direction)
and repeats (sequences of letters or numbers which are repeating at
least twice within a string) in some strings containing between
20-5000 letters. Has somebody any idea how could I perform that using
an Excel macro? I would like that the string to be evaluated could be
on cell "A1" and that the detected palindromes and repeats could be
listed bellow A2 and C2, respectively; and that the number of times
that they appear in the sentence could be listed bellow cells B2 and
D2, respectively, as the following small example:


QGAGGAAGGAGQ
Palindromes Number Repeats Number
QGAGGAAGGAGQ 1 GA 3
GAG 2 AG 3
GG 2 GAG 2
AA 1 AA 1
GG 2


Somebody could help me?
Thanks in advance,
Luciano


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Macro for detect and list palindromes and repeats in letters/numbers string

For palindromes it is necessary only count them from one
mirroed side since the other side will be identical.


That is not always true. Here are two examples palindromes (one with an odd
number of characters and the other with an even number of characters)... the
first repeats AFA across the middle of the "mirror" and the other repeats
ABBA across the mirror.

AFADAFADAFA

ABBAABBAABBA

Can I assume you want them to be counted as well? I think this may be a hard
problem to solve, but I want to understand all the rules before I try.

--
Rick (MVP - Excel)


"Luciano Paulino da Silva" wrote in message
...
Thank you very much Rick.
In fact, I forgot to talk about that. You are right, and I forgot some
of the potential palindromes, including AA, GAAG and GGAAGG. I needs
of all palindromes that could be generated for a given string. In some
case, they will be subsequences of other palindromes. It is necessary
include palindromes from 2 to any size. For palindromes it is
necessary only count them from one mirroed side since the other side
will be identical.
The repeats will be characterized by any sequence (from 2 to any size)
that appear at least 2 times in the string. In fact, AA is not a
repeat, since it appeared only one time.
Thank you for your observations,
Luciano

On 14 abr, 13:14, "Rick Rothstein"
wrote:
What is the "rule" for forming the included (smaller) palindromes? For
example, why isn't AA, GAAG, GGAAGG, etc. considered included
palindromes?
Is the rule "only from one of the mirrored sides"? If so, why do you
count
the "repeats" from either of the mirrored sides?

--
Rick (MVP - Excel)

"Luciano Paulino da Silva" wrote in
...

Dear all,
I am looking to detect palindromes (sentence or number or other
sequence of units that can be read the same way in either direction)
and repeats (sequences of letters or numbers which are repeating at
least twice within a string) in some strings containing between
20-5000 letters. Has somebody any idea how could I perform that using
an Excel macro? I would like that the string to be evaluated could be
on cell "A1" and that the detected palindromes and repeats could be
listed bellow A2 and C2, respectively; and that the number of times
that they appear in the sentence could be listed bellow cells B2 and
D2, respectively, as the following small example:


QGAGGAAGGAGQ
Palindromes Number Repeats Number
QGAGGAAGGAGQ 1 GA 3
GAG 2 AG 3
GG 2 GAG 2
AA 1 AA 1
GG 2


Somebody could help me?
Thanks in advance,
Luciano





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Macro for detect and list palindromes and repeats inletters/numbers string

Yes, you are correct. In this case, these palindromes that you have
suggested should be counted.
Thank you for your help.
Luciano

On 14 abr, 13:42, "Rick Rothstein"
wrote:
For palindromes it is necessary only count them from one
mirroed side since the other side will be identical.


That is not always true. Here are two examples palindromes (one with an odd
number of characters and the other with an even number of characters)... the
first repeats AFA across the middle of the "mirror" and the other repeats
ABBA across the mirror.

AFADAFADAFA

ABBAABBAABBA

Can I assume you want them to be counted as well? I think this may be a hard
problem to solve, but I want to understand all the rules before I try.

--
Rick (MVP - Excel)

"Luciano Paulino da Silva" wrote in ...

Thank you very much Rick.
In fact, I forgot to talk about that. You are right, and I forgot some
of the potential palindromes, including AA, GAAG and GGAAGG. I needs
of all palindromes that could be generated for a given string. In some
case, they will be subsequences of other palindromes. It is necessary
include palindromes from 2 to any size. For palindromes it is
necessary only count them from one mirroed side since the other side
will be identical.
The repeats will be characterized by any sequence (from 2 to any size)
that appear at least 2 times in the string. In fact, AA is not a
repeat, since it appeared only one time.
Thank you for your observations,
Luciano


On 14 abr, 13:14, "Rick Rothstein"
wrote:
What is the "rule" for forming the included (smaller) palindromes? For
example, why isn't AA, GAAG, GGAAGG, etc. considered included
palindromes?
Is the rule "only from one of the mirrored sides"? If so, why do you
count
the "repeats" from either of the mirrored sides?


--
Rick (MVP - Excel)


"Luciano Paulino da Silva" wrote in
...


Dear all,
I am looking to detect palindromes (sentence or number or other
sequence of units that can be read the same way in either direction)
and repeats (sequences of letters or numbers which are repeating at
least twice within a string) in some strings containing between
20-5000 letters. Has somebody any idea how could I perform that using
an Excel macro? I would like that the string to be evaluated could be
on cell "A1" and that the detected palindromes and repeats could be
listed bellow A2 and C2, respectively; and that the number of times
that they appear in the sentence could be listed bellow cells B2 and
D2, respectively, as the following small example:


QGAGGAAGGAGQ
Palindromes Number Repeats Number
QGAGGAAGGAGQ 1 GA 3
GAG 2 AG 3
GG 2 GAG 2
AA 1 AA 1
GG 2


Somebody could help me?
Thanks in advance,
Luciano


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro for detect palindromes and repeats in letters/numbers string Luciano Paulino da Silva Excel Worksheet Functions 33 April 16th 09 04:59 PM
Macro for detect palindromes and repeats in letters/numbers string Luciano Paulino da Silva New Users to Excel 5 April 14th 09 08:44 PM
Macro for detect palindromes and repeats in letters/numbers string Luciano Paulino da Silva Excel Programming 1 April 14th 09 06:11 PM
How do I randomize a list without repeats K9CE Excel Discussion (Misc queries) 2 October 13th 05 07:01 PM
detect upper and lower case letters mike allen[_2_] Excel Programming 3 June 5th 04 04:58 PM


All times are GMT +1. The time now is 08:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"