473,396 Members | 2,129 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Comparing Strings by Character

hello everyone
can anyone suggest me the perl code for comparing two sequences by each character wise and to print the characters which are not matched .... can anyone give me a hint on this
Jul 24 '07 #1
3 2438
JosAH
11,448 Expert 8TB
hello everyone
can anyone suggest me the perl code for comparing two sequences by each character wise and to print the characters which are not matched .... can anyone give me a hint on this
I'll move your thread over to a Perl forum where your question can be better
answered. Best of luck.

kind regards,

Jos
Jul 24 '07 #2
prn
254 Expert 100+
hello everyone
can anyone suggest me the perl code for comparing two sequences by each character wise and to print the characters which are not matched .... can anyone give me a hint on this
Hi,

Maybe you can give us a hint on what you want to do with the sequences. What do you want to do with them once you hit a non-match? Consider the following sequences and give us a clue.

Expand|Select|Wrap|Line Numbers
  1. abcdefghihk
  2. abc123456
  3.  
Expand|Select|Wrap|Line Numbers
  1. abcdefghihk
  2. abc123ghihk
  3.  
Expand|Select|Wrap|Line Numbers
  1. abcdefghihk
  2. abc123defghihk
  3.  
Expand|Select|Wrap|Line Numbers
  1. abcdefghihk
  2. abcd1e2f3ghihk
  3.  
What would you want the outputs to be from these? Would you want to handle them differently? Would you want to handle them the same? Why?

Your question may or may not involve some pretty sophisticated pattern matching algorithms. There's no way we can answer without more thought and input from you. There simply is no "the perl code" to do something as undefined as your question. I'm not trying to be a wise-guy or to be mean to you, but so far your question is just not adequate as a software specification. Right now, the best we can possibly do for you is to try to help guide you to a better question.

If my example sequences are helpful in doing that, good. If they are not, then maybe you can use my poor examples to help you construct better examples, but we need better examples to construct an idea of what you want. Once we can all reach an answer to what you want then (and only then) can we sensibly try to do it in perl (or anything else).

Best Regards,
Paul
Jul 24 '07 #3
numberwhun
3,509 Expert Mod 2GB
hello everyone
can anyone suggest me the perl code for comparing two sequences by each character wise and to print the characters which are not matched .... can anyone give me a hint on this
Sure, we can point you in the right direction, but first, we need a couple of things:

1. A better explanation of exactly what you are looking for, as requested by 'prn'
2. The code that you have tried thus far.

We aren't a code writing service, but would be happy to give you and your code a nudge now and again.

Regards,

Jeff
Jul 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: agent349 | last post by:
First off, I know arrays can't be compared directly (ie: if (arrary1 == array2)). However, I've been trying to compare two arrays using pointers with no success. Basically, I want to take three...
3
by: Robert Dell | last post by:
I have a problem comparing strings in an order form i'm writing. I want to give a running total at the bottom of the page and it appears to be working except it doesn't compare correctly (it...
41
by: Odd-R. | last post by:
I have to lists, A and B, that may, or may not be equal. If they are not identical, I want the output to be three new lists, X,Y and Z where X has all the elements that are in A, but not in B, and...
88
by: William Krick | last post by:
I'm currently evaluating two implementations of a case insensitive string comparison function to replace the non-ANSI stricmp(). Both of the implementations below seem to work fine but I'm...
2
by: ddd | last post by:
I am trying to build a diff tool that allows me to compare two HTML files. I am looking for resources on how to achive this. The main problem is that I do not want to simply highlight the line of...
10
by: william | last post by:
#include <stdio.h> int main() { char *str=NULL; char x="today is good!"; printf("%s", str); str=strtok(x," "); if (str=="today") //<==here is line that confuses me printf("they equals!\n");
6
by: cutlass | last post by:
Need help in thus script. Trying to create the script that uses comparison operators and functions to compare two strings entered by user. When I add in the info in the script section everything...
3
by: igor | last post by:
My database is Latin1_General_BIN. My table is called CUSTOMER. One column in this table (descr_id) is defined as char(10). When I query… SELECT * FROM CUSTOMER WHERE descr_id = ‘ABCD’
5
by: =?Utf-8?B?UElFQkFMRA==?= | last post by:
Not really a C#-specific comment, more general .net observations. 1) A while back I found the need to determine whether or not a particular StringComparer was case-insensitive. The best way I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.