Questions tagged [string-search]

String searching algorithms (also known as string matching algorithms) are an important class of string algorithms that try to find a place where one or several strings (also called patterns) are found within a larger string or text.

String searching algorithms (also known as string matching algorithms) are an important class of string algorithms that try to find a place where one or several strings (also called patterns) are found within a larger string or text.

Use this tag for programming questions related to string searching algorithms.

Source: Wikipedia

261 questions
0
votes
3 answers

filter word in string

I'm using PHP to query users and their attributes in Active Directory. The problem I have is that the LDAP field for Department Manager is not only returning the user name, but also the FQDN (fully qualified domain name) path as shown below: CN=User…
0
votes
1 answer

Efficient string search in DynamoDb

I'm currently investigating various data storage options for a Xamarin mobile app: RESTFul service with a SQL backend (MySql or Postgres) or DynamoDb; both on AWS. I would prefer to make use of the DynamoDb because it is "fully managed" and it is…
trentinb
  • 371
  • 3
  • 5
0
votes
2 answers

Search a file and migrate search term is in to a new file

This code enables to create a new .txt file, if the file doesn't exist yet, it will create the file.
woninana
  • 3,409
  • 9
  • 42
  • 66
0
votes
1 answer

KMP algorithm worst case analysis

I can't understand how KMP maintains O(m+n). I'm looking for a pattern "aaaab" in "aaaaaaaaaa...". pattern : aaaab (length n) string : aaaaaaaaaa... (length m) Then the prefix table would be aaaab 01230 Every time mismatch happens on 'b', it's…
0
votes
1 answer

Netezza string searching (fuzzy searching)

As far as I know Netezza for string searching only offers two functions le_dst(str_expr_1, str_expr_2) and dle_dst (str_expr_1, str_expr_2) as mentioned here Are there any other more advanced options for fuzzy searching in netezza like oracle has…
hidross
  • 123
  • 3
  • 16
0
votes
2 answers

How to neglect blank spaces in a string search in html file using java?

I have a html file which I have to search line by line and look for a particular string and then take some actions accordingly. The problem is that the string is being matched to the entire line of the each line of the html file. So if there are…
Ankit Sahay
  • 41
  • 1
  • 8
0
votes
2 answers

find the intersection of 4 files

How do you find intersection of 4 files? I used grep -Fx -f 1.txt 2.txt 3.txt 4.txt, but it seems that it only works for 2 files. Similarly comm -12 1.txt 2.txt can't be expanded to 4 files and requires data to be sorted. My data isn't sorted, in…
sanjihan
  • 5,592
  • 11
  • 54
  • 119
0
votes
1 answer

Python script - String Search - Arista

I'm trying to run a script on arista switch, which is a simple python script. I got some values by running a command on the switch and I need to find a value from that command. for eg: #!/usr/bin/python from jsonrpclib import Server switch =…
Hari
  • 3
  • 1
0
votes
2 answers

Python/Biopython: How to search for a reference sequence (string) in a sequence with gaps?

I am facing the following problem and have not found a solution yet: I am working on a tool for sequence analysis which uses a file with reference sequences and tries to find one of these reference sequences in a test sequence. The problem is that…
0
votes
1 answer

Randomly search a text file for keyword using fastest & efficient string-search method

I've got a text file with one customer record per line. Each record is formatted as "ID num, first name, last name, dollar amount". I need to read a line of this text file based on the ID number entered by the user. I've been following a Java ebook…
Space Ostrich
  • 413
  • 3
  • 5
  • 13
0
votes
0 answers

How do I search for a string read from a .csv file in a dataset with some extra words in the string in R language?

I want to match the string from a dataset i.e. Indian Inst Technol, Dept Mech & Ind Engn, Roorkee; to INDIAN INST TECHNOL ROORKEE which is read from a .CSV file. How do I match it correspondingly and increment the IIT Roorkee counter? Edit I…
0
votes
2 answers

Morris Pratt table in Fortran

I have been tried to do the Morris Pratt table and the code is basically this one in C: void preMp(char *x, int m, int mpNext[]) { int i, j; i = 0; j = mpNext[0] = -1; while (i < m) { while (j > -1 && x[i] != x[j]) j = mpNext[j]; …
wdarking
  • 159
  • 9
0
votes
1 answer

Building NER using Sequence Alignment algorithms

Background: Wikipedia page on Sequence Alignment says that DNA Sequence Alignment algorithms can also be used for Natural Language Processing. Question: Because Named Entity Recognizer and DNA Sequence Libraries both do Approximate String Matching -…
0
votes
1 answer

Bubble Search guided by user input?

I'm writing a program that helps a user make a Top X or top favorites list. The user will first enter the number of items that will be on the list which is then used to create an array of the same size. Then the user populates the array. Finally…
dpolaristar
  • 69
  • 1
  • 8
0
votes
0 answers

Android- IMAP- search keyword from email

The Android application I'm working on right now is to search for the keywords "friend" and "important" in the mail(specifically in the subject and content) received in the inbox for the email given, which is implemented using IMAP to connect and…
Ashwin Praveen
  • 661
  • 2
  • 10
  • 20