CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Need a Custom or Prewritten Perl Program?: I need a program that...:
Joining two strings by matching positions of an alphabet in both strings in Perl

 



prashant
New User

Oct 9, 2012, 9:30 PM

Post #1 of 4 (7123 views)
Joining two strings by matching positions of an alphabet in both strings in Perl Can't Post

I need a Perl script where a string get fragmented at every occurrence of 'E' and when user enters positions of 'C' through command line (say 3-8 or 3-8,13-18 or any comma separated such positions of 'C' according to the string in such format if the string is long), the fragments containing 'C' (say at 3 and 8 positions) should be joined and shown in the output.

Suppose string is "ABCDEABCDEABCDEABCDEABCDE" and user enters 3-8 then program oputput should be-

ABCDEABCDE

ABCDE

ABCDE

ABCDE


prashant
New User

Oct 14, 2012, 9:43 PM

Post #2 of 4 (6932 views)
Re: [prashant] Joining two strings by matching positions of an alphabet in both strings in Perl [In reply to] Can't Post

Somebody help please!


Laurent_R
Veteran / Moderator

Oct 15, 2012, 4:08 AM

Post #3 of 4 (6906 views)
Re: [prashant] Joining two strings by matching positions of an alphabet in both strings in Perl [In reply to] Can't Post

I would be glad to help and it does not seem to be very difficult, but I don't understand what you are trying to do.


BillKSmith
Veteran

Oct 16, 2012, 5:51 AM

Post #4 of 4 (6881 views)
Re: [prashant] Joining two strings by matching positions of an alphabet in both strings in Perl [In reply to] Can't Post

Please post the specifications that you had in the intermediate forum. We will have more questions, but that would be a start.

Questions that I do remember:

Does every segment contain a 'C'?

Can a segment be used in more than one pair?

Are you using ActiveState perl? I would like to use their prompt module.
Good Luck,
Bill

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives