Questions tagged [string-comparison]
string-comparison is the action of comparing strings, resulting in a boolean or an integer indicating the "distance" between the strings.
2,135
questions
0
votes
1
answer
22
views
UTF to ASCII for comparison in JAVA
I have a list of strings and i want to compare it with "singleArgument" , i dont want it to be case sensitive so i made a method to make it lowerCase but also i dont want special characters ...
0
votes
0
answers
48
views
Is it possible to compare the strings inside a 2D array and do calculation in the 2D array?
is it possible to compare the strings inside a 2D array and do calculation in the 2D array? I've wrritten the code out and it doesn't shows me any error, but it stopped executing after the data in the ...
0
votes
1
answer
22
views
Using bash: Remove list of directory names from a file containing said directory names and other text
I have a text file containing 100s of directory names, one per line.
Such as:
Directory1
Directory2
etc...
I have a directory filled with subdirectories named let's say Directory5 through Directory10....
0
votes
0
answers
33
views
Is there an EF Core function (using SQL Server) to calculate levenshtein distance or a similar string comparison to sort a table by string similarity?
I found EF.Functions.TrigramsSimilarityDistance at https://github.com/npgsql/npgsql for postgresql.
And I found a raw sql solution here:
Levenshtein distance in T-SQL
I could use by implementing a ...
0
votes
3
answers
42
views
How can I reference a string (e.g. 'A') to the index of a larger list (e.g. ['A', 'B', 'C', 'D', ...])?
I have been racking my brain and scouring the internet for some hours now, please help.
Effectively I am trying to create a self-contained function (in python) for producing a caesar cipher. I have a ...
0
votes
1
answer
35
views
Detect different words in strings of two arrays and output them in third array
I have a function that outputs the different words of two strings. This works fine until I want to iterate over two arrays that contain strings and output a third array that shows me the "extra&...
-2
votes
0
answers
75
views
Why string comparison doesn't work when both string are same?
I am trying to compare two vector string for a problem, the string comparison works perfectly if there is one input of the string "barakallah", but once there are more inputs for string ...
-1
votes
3
answers
38
views
How to compare two lists which have strings in them in python?
I have these two strings:
list1 = ['M', 'AR0', 'I', 'K', 'Y']
list2 = ['M', 'AR0', 'IY', 'K', 'U']
I want the output "Yes" when the two elements in the same position are equal and "No&...
1
vote
1
answer
94
views
create a calculated column from comparing two columns based off a substring in the columns in sql
I have the following dataset
Drawing Name
Line Number
Line Details
PL00XXX-0705-1300
2"-MSH-0513-16-C1-1 1/2"A
MATCH
PL00XXX-0705-1100
2"-MSH-0513-16-C1-2"AE
DUPLICATE / HEAT ...
0
votes
2
answers
41
views
Is there any mistake in comparing strings in JS?
I'm making tic tac toe game and I'm facing issue. If user's input is not equals to X or O then it should print the message Enter correct signs but I have no idea what's wrong in my code. Only else if'...
0
votes
0
answers
23
views
Algorithm to compare two strings, obtaining an score
In my workplace, we are trying to look for an algorithm that compares two strings, and returns an score of proximity, that we could use to compare the models names of the different CPUs we have in our ...
0
votes
1
answer
16
views
How I compare the two strings of digits of size >=100 ? Because on using stoi and stoll giving me overflow RUNTIME ERROR
How I compare the two strings of digits of size 100 ? Because on using stoi and stoll giving me overflow RUNTIME ERROR
terminate called after throwing an instance of 'std::out_of_range'
what(): stoll
...
0
votes
3
answers
59
views
String Comparison with Keys on XSLT 1.0 transform
I'm currently working on an xslt using xslt 1.0 to look at a response from a webservice and tell me if there is a difference in value. Issue is the response is dynamic. I am having some issues with ...
-2
votes
0
answers
64
views
AWK Match variable and Increment field value
I am trying to find and replace numeric value based on a variable and increment field 2 value in a csv file
Contents of data.txt
NY,1
CA,1
NJ,1
Variable Value
PS=NY
Code Snippet
awk -v x=$PS -F, '{ ...
0
votes
1
answer
44
views
C program to compare each word of a 2D array to all words of the order 2D array
I created 2 2D arrays containing words. For example:
loadKey[25][30] =
{
{'J','a','v','a','\0'},
{'P','y','t','h','o','n','\0'},
{'C','+','+','\0'},
{'H','T','M','L','\0'},
{'S','Q','L'...
-1
votes
1
answer
43
views
How can I import multiple CSVs to preset sheets? [closed]
I have some CSV files on my G-drive that I want to import to preset sheets, based on file names. For example,
I have CSV files named: "REP1-abc", "REP2-bcd", "REP3-cde",....
0
votes
1
answer
68
views
Text comparison between multiple files and remove the duplicate block
I have 3 notepad files in directory , i want to compare 1st file to other 2 and drop the duplicate blocks keep unique output , for Example :
File 1:
User enter email id {
email id:(xyz@gamil.com)
...
2
votes
1
answer
52
views
How to compare file on local PC and github?
I have a file on my PC called test.ps1
I have a file hosted on my github called test.ps1
both of them have the same contents a string inside them
I am using the following script to try and comapare ...
1
vote
0
answers
74
views
Comparing Strings using == vs Ordinal
MS docs recommend using Ordinal for better Performance and for comparisons as your safe default for culture-agnostic string matching.
But curious to know how comparing using == differs in terms of ...
0
votes
2
answers
32
views
Python Pandas: Comparing two columns and returning string value if first column include character in the string
I have 2 columns first with string including X or F and second is empty.
If there is any X in column 1 I want to assign 'YES' to second column if there is no X assign 'NO'
Every time I run my code it ...
0
votes
0
answers
15
views
script of 2 conditions with different value comparisons
I want to create a script where theres two comparisons of 2 values then it compares it if meets the desired condition then sendds echo output. for example:
I have a value of:
A = 10
B = 15
the ...
2
votes
2
answers
64
views
Compare two columns in pandas to update date column in a dataframe
I need to compare a certain range of value of a column with a specific string in another column to update the date column with 1,7, 30 days
Col A ColB colc
5 Internal 1-1-...
2
votes
4
answers
117
views
Compare String elements in an Array
I am trying to compare elements in Array. for example,
labels = ["abc1","abc2","abc3","abc4"]
I want to take the String with the highest values. In this case ...
1
vote
1
answer
43
views
Is there a function to compare two strings using a custom homoglyphs list
I need a function that would compare two strings and outputs an edit distance like Levenshtein, but only if the characters are homoglyphs in cursives. I have a list of those homoglyphs so I could feed ...
0
votes
1
answer
25
views
How to properly find the matching character in another string
i would like to know the best way to compare a single character of a string to another whole string and find the matching character so to say. The probably most important snippets of my code are the ...
0
votes
1
answer
35
views
Dataframe compare EQ - position doesn't matter
Reading this article - https://datatofish.com/compare-values-dataframes/ while helpful it doesn't help with my use-case in that I have multiple prices per product. ie product1 = computer has price = ...
0
votes
1
answer
37
views
Receiving same output in if and else condition, how to resolve?
I am trying to execute below program but it give same output, in if else condition. In output I only get Working day only even I give value as sunday.
#include <stdio.h>
int main(void)
{
char ...
-3
votes
2
answers
72
views
how to compare the two names in array list
I am trying to compare the two names in the baby array list if it is true it will return "Two babies in the array are the same" if false will return "No same baby in the array".
...
0
votes
0
answers
18
views
I used python recordlinkage library to find the duplicates,got the index pairs but now have to make a single csv by putting duplicates in a cluster
having MultiIndexes like this ([( 4061, 1461),
( 5011, 4608),
( 7189, 446),
( 9505, 3120),
( 9926, 1534),
length=4063)
but now i have to make a dataset of all the duplicates found at these ...
-1
votes
2
answers
44
views
Python and list compare
list1 = ['bd 100bd has 15', 'bd 100abd has 0', 'bd 100bbd has 10', 'bd 100cbd has 0', 'bd 100dbd has 0']
list2 = ['100', '100a']
new_list = []
idx =0
for item in list1:
if any(x in line for x ...
-2
votes
1
answer
61
views
String.Compare and how it actually function (IComparable implementation)
Well...I rewrote my post completely to allow anybody to understand what I am actually trying to understand. I just want to understand how String.Compare (string, string) actually function and ...
1
vote
2
answers
75
views
Is there a way to compare "\x3C!--" with "<!--" and get 'true' in JavaScript?
In one of my projects I have to parse HTML pages and to check if each parsed "tag candidate" is in the predefined list of tag defining strings.
The problem emerges when for some reason the ...
1
vote
1
answer
90
views
Haskell comparing characters in a word
I'm trying to make a function that will check how many characters are matching in a word
The characters are non-repeating A-Z. The position of the letters doesn't matter
INPUT target = "ABCDE&...
0
votes
0
answers
58
views
Compare String Arrays in C
I'm trying to compare two string arrays. I write a method which called compare this method compare two string arrays and if it find same element in this arrays it stores that string in "intersect&...
-1
votes
1
answer
62
views
Compare two List<string> in c# and find the duplicates
I've tried the methods here:
Compare two List<string> and print the duplicates
Is there any way to compare two lists in C#
https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/...
-3
votes
1
answer
34
views
compare list with input
def calculate():
operator = input("What operator do you wanna use(*,/,+,-)? ")
possible_op = ["*", "+", "-", "/"]
if not operator == ...
2
votes
4
answers
61
views
Do-while or while loop that will keep taking an input from user but will terminate after I input the string "exit" (case insensitive) in c language
#include <stdio.h>
#include <ctype.h>
int main() {
char str[100];
char out[] = "exit";
do {
printf("Enter a string: ");
scanf("%s&...
0
votes
0
answers
42
views
I want to check if the .csv file contains the exact data without any leading and trailing spaces
I changed the code to this. Can someone tell me what is the keyword i should use to remove spaces(trailing and leading. Something is not working. I cant figure out what. Also, I am getting a ',' in ...
0
votes
0
answers
13
views
How to show a different set of list depending on the first AutoCompleteTextView value?
courseCompletetextView = (AutoCompleteTextView) findViewById(R.id.course);
String CourseCompleteTextView = courseCompletetextView.getText().toString().trim();
autoCompleteTextView = findViewById(R....
5
votes
0
answers
76
views
Illogical string comparison in PHP [duplicate]
I got lost.. if someone could explain to me why the following query:
var_dump("0000F607"=="00000000");
is returning: bool(false)
but fallowing query: var_dump("0000E607"==...
0
votes
2
answers
49
views
JQuery search and compare part of word in array
I'm beginner with JQuery, and I have my first issues ! ;)
I want to search particuliar word/number from array in many url.
I list URLs in an "aLinks" array.
The URLs of aLinks are in the ...
-1
votes
2
answers
33
views
Want get value of other list where value matched
I have two lists which are following.
characteristic = ['length', 'width', 'height', 'Thread length', 'space']
value = ['length 34','width ab23','Thread length 8ah','space','height 099']
I have ...
-2
votes
1
answer
54
views
Compare two string char by char and highlight the different ones
I need a function that will take 2 strings and return the second one with highlighted mismatched characters with html code.
For example:
dbo.function('Jack', 'jake')
will return a string:
'ja<font ...
0
votes
2
answers
54
views
Performance variance among string-compare methods
As a student, I have a course about using new features in Python3.8+ and it also includes Python3.10. So I'm now trying to use match-case in my homework to kill a long series of if-else which should ...
0
votes
2
answers
81
views
Is there a way to compare a date stored as a string with the tm structure included in the ctime library?
In my c++ project about an Airline Reservation System, I have a class member variable for the date stored as a string (i.e. "4/20/2022") and now I need to store the time as well so I added ...
-2
votes
1
answer
39
views
String obtained from ResultSet does not match normally defined String of the same content
I have a simulation for a hospital management system. Accompanying that is an Azure SQL server to store log information and the user access levels within the system (referred to as variable access in ...
-1
votes
1
answer
149
views
How can I compare a user input to a specific char?
I want to compare a user input to specific char in Rust.
For example I would print something like: "Press "q" to quit" and the user should enter the letter "q" and press ...
0
votes
2
answers
62
views
Openpyxl: backfill a row that has a cell with a partial string match?
I'm working on a program that filters a large .xlsx file and then splits those filtered sets out onto new sheets in a new workbook.
One problem I'm trying to fix, is recreating the old format on the ...
0
votes
0
answers
17
views
Why is a string treated differently by comparison operators after assignment by scanner.nextline() input [duplicate]
I was coding a user input loop for a class project, and I ran into a roadblock where a string wasn't being accepted by comparison operators after it had been altered by scanner.nextline() input. Here ...
-1
votes
1
answer
24
views
How do I analyze data from two different sources with a little different structers?
So for example say there's a website that shows all the events available around my area in the next 2 weeks. But there's also another website that provides the same data labeled a little differently. ...