256 questions
1
vote
1
answer
70
views
Counting the total number of instances of multiple text strings in a range of cells in LibreOffice Calc
The following function works well counting instances of a substring within text in a single cell.
=(len(A1)-len(substitute(A1;A2;"")))/len(A2)
I am looking to extend its capabilities to ...
0
votes
0
answers
128
views
How to rigorously compare my String-Search algorithm against current benchmarks. Currently beating/equaling Boyer-Moore ~half the times in my test
A String Search algorithm I wrote is performing incredibly well in my own test, but I'd like to test it more rigorously to know how well it objectively performs. Anyone know of a resource I can use to ...
0
votes
3
answers
1k
views
How to extract elements of strings in a list based on the presence of a substring in python?
I have a list which contains elements of strings. I am trying to capture the elements if it has specific substring into another variable by removing it in the original list.
Org_list = ["I am ...
-2
votes
1
answer
65
views
Writing a simple function which returns True if there is a duplicate character present
So basically as in the title. Here is what I am trying to do:
3
24 function RepeatedChar (l: char; s: string): boolean;
25 var
26 c, ordl, ords: integer; {counter}
27 begin
28 c := 0;
29 ...
1
vote
2
answers
54
views
String search with dynamic lengths against a file
The task I am trying to perform is: e.g. I have a string "Simultaneously", I would like to perform a search of this string with dynamic lengths against strings in a file (contains some ...
0
votes
2
answers
623
views
Algorithms and techniques for string search across multiple GiB of text files
I have to create a utility that searches through 40 to 60 GiB of text files as quick as possible.
Each file has around 50 MB of data that consists of log lines (about 630.000 lines per file).
A NOSQL ...
0
votes
1
answer
210
views
Hide list item using data attribute when specific text is present on the page with JS
This is trying to hide a checkout payment option from appearing when specific items are in cart (shown on the same page). If the text "BULK" appears in the cart/page to hide a list option ...
0
votes
3
answers
865
views
Am I misunderstanding find_first_not_of?
Consider the following program:
#include <string>
#include <iostream>
int main() {
std::string token {"abc"};
const char* option_name_valid_chars =
"...
1
vote
0
answers
141
views
Understanding Rabin-Karp algorithm with modulo arithmetic
I am having a hard time understanding the Rabin-Karp algorithm with modulo arithmetic. My questions.
Why we use modulus to determine the hash of the string being analyzed?
How to determine the ...
0
votes
0
answers
471
views
finding a string in a large text and return the paragraph which the string is in that paragraph
Hi I wanna search a string in a large text and return the paragraph which involve the string. (In Python)
Here is the example of the data that need to be searched:
https://raw.githubusercontent.com/...
0
votes
2
answers
94
views
Debugging, I am trying to find where in this code these errors coming from
Attempting to diagnose this output from a script I have to debug.
make[1]: Entering directory '/home/dwulf/sifchain/sifchain-validators'
/bin/sh: 1: Syntax error: Unterminated quoted string
make[1]: **...
2
votes
1
answer
443
views
Can CRC32 be used as a "Rolling Hash" as with the Rabin–Karp string search algorithm?
I have a hardware CRC32 peripheral on a MCU that I would like to use to speed up string search. Normally this is done with one of the rolling hash functions described here https://en.wikipedia.org/...
0
votes
1
answer
187
views
Algorithm to recursively search Git repo for a string
I am working on a project to automate the code review process for a team of engineers. Basically, what happens is every time an engineer makes a change to a file, before those changes are pushed to ...
0
votes
0
answers
55
views
Match block of strings from a text file
i read multiple discussions similar to my issue but i can't find a working solution!
I have a txt file make like that:
blah L1 blah
**ON**
...(uninteresting)
...(uninteresting)
conf1
...(...
2
votes
1
answer
564
views
Check if substring of a string exists in datatable
I have a DataTable like this:
column1 column2
----------- ----------
1 abc d Alpha
2 ab Gamma
3 abc de Harry
4 xyz Peter
I want to check if a substring of a string ...
1
vote
0
answers
162
views
Algorithm to Check if Strings are Equal Allowing Rotations and up to K Replacements
Imagine the problem of finding if one string "STR1" is a rotated version of another string "STR2". This problem is simple and just requires searching for either string in the other ...
-1
votes
1
answer
108
views
Compare first word of each line of a file to a variable in php
I've just started php and I can't find an easy way to compare to a variable each first word of a line of a text file in a format("userid firstname lastname password").
1
vote
1
answer
588
views
Python: Provide a string, open folder that contains the string in the folder name, then open/read a file in that folder
I have a highly branched folder structure as shown below. I want to match a barcode, which is nested between other descriptors and open/read a file of interest in that barcode's folder. The contents ...
0
votes
2
answers
106
views
how to search the result from a string input in a list
Hi i need to make a project for school where people can insert a review but before the review is posted on twitter it is going to be placed in a database. before it is going to be posted in twitter a ...
-1
votes
3
answers
1k
views
Find out the maximum number of decimal places within a string of numbers
The string looks like this like something along the lines of 3*2.2or 6+3.1*3.21 or (1+2)*3,1+(1.22+3) or 0.1+1+2.2423+2.1 it can vary a bit. I have to find the amount of decimal places in the number ...
1
vote
1
answer
69
views
How do I open a list of txt files, convert them to strings, and then see if they match any keys from a given dictionary [closed]
I have a list of text files (list_4), of the format cv1.txt, cv2.txt, cv3.txt etc, up to cv20.txt. I want to use a for loop to open and read these files indivdually and convert them into strings. This ...
5
votes
1
answer
178
views
Product name string matching against a trie (supporting omissions)
I have a list of CPU models. Right now, I think the most suitable approach would be forming a trie from the list, like this:
Intel -- Core -- i -- 3
| | |- 5
| | |- 7
...
1
vote
1
answer
187
views
Find occurrences of the adjacent sub strings in the text
I have a text of the Word document and an array of the strings. The goal is to find all occurrences for those strings in the document's text. I tried to use Aho-Corasick string matching in C# ...
0
votes
0
answers
292
views
Horspool list all instances of string
I'm trying to use the Horspool algorithm to list all instances of a pattern in a string.
My string is very long, north of 3 million characters.
On windows, my code only finds the first ~230 instances ...
-3
votes
2
answers
931
views
I want to find the index of the string in an array
I have to search a string in an array from the user input, but I have an error in my logic. Even when the user input is in the array I still get "data not found"
I also have to display the index ...