Questions tagged [find-occurrences]

435 questions
1
vote
2 answers

Occurrence of symbol A found anywhere in L. LISP

Here is my function (defun freq (symbol_A List_L) (cond ((atom (car List_L)) (cond ((eq (car List_L) symbol_A) t (+ 1 (freq symbol_A (cdr List_L)))) (t 0))) (T (freq symbol_A (cdr List_L)))) ) I am getting an error…
Yaroslav Dukal
  • 3,894
  • 29
  • 36
1
vote
5 answers

Python: Return the words in a string that occur exactly once

Let's say I have a function that takes in some string, and then I need to return the set of words in this string that occur exactly once. What is the best way to go about doing this? Would using dict be helpful? I've tried some pseudocode…
J. P.
  • 289
  • 4
  • 14
1
vote
1 answer

Tableau Filtering on ocurence of a String

I have a Field in my Column that is filed with a String that can have a multiple occurence of the same word. Now what i want to do is to Filter this Column so that a certain Word mus occure and that only the rows show up where another word don't…
Vedad
  • 223
  • 4
  • 15
1
vote
1 answer

Count number of word occurrences, allowing for special characters and linebreaks

I am trying to build a function that will count the number of occurrences of a word in a phrase. The function should include cases where the word in the phrase has additional non-alphabetical characters and/or end-of-line characters. function…
sale108
  • 577
  • 7
  • 22
1
vote
2 answers

finding occurrence in a content of variable through php code

I want to realiaze a php code that help me to detect the content of the variable CEllname and which repeat more than 6 times. for exemple $cell_old =a,b,c,d,d,d,d,a,d,e,d ( the letter d is repeating for 6 or more )so : $cell_new=d thanks alot
1
vote
1 answer

Setting occurrence number in Sqlserver

Can anyone check my sql query, when using a select statement, the occurrence_number column shows correct values. select t.[Employee Number], t.Document_Type, t.Document_Name, row_number() over (partition by document_type …
yope
  • 35
  • 1
  • 8
1
vote
1 answer

Set occurrences in SQL

I have a requirement to set the occurrence number of each document type and sort according to document name. Any chance on how to do this in MS SQL 2008? here are the scenarios: If the document type is unique, update the occurrence number of that…
yope
  • 35
  • 1
  • 8
1
vote
2 answers

count the frequency of a given word in text file in Ruby

I want to be able to count the number of occurrences of a given word (input for example) in a text file. I have this code and it gives me the occurrence of all the words in the file : word_count = {} my_word = id File.open("texte.txt", "r")…
Xibition
  • 197
  • 1
  • 4
  • 11
1
vote
1 answer

find the number of occurences and add it next to the pattern

I have several files in a directory and in some of them, some patterns occur multiple times. For example Contents of file "8_list": Spiroplasma_taiwanense Spiroplasma_diminutum Spiroplasma_apis Spiroplasma_sabaudiense Spiroplasma_taiwanense…
Panos
  • 179
  • 2
  • 13
1
vote
2 answers

Histograms too different compared to how they should be

I have a black/white image I0 (512 x 512) to which I have to remove the first k pixel and calculate the histogram of the resulting image. Let me explain: I have to build the histogram of the image I0 without considering the first k pixels. This is…
user7558372
1
vote
1 answer

How to search string references in specified location?

I'm trying to find the occurence of elements list(from a text file) in a directory. Below is the Bash code I'm using ,but I'm unable to get the output of grep command on to console. !/bin/bash FILENAME=$1 count=0 while read LINE do let count++ …
Vaishanavi
  • 11
  • 1
1
vote
1 answer

Getting the count of duplicate values in arrayList in Java without affecting the order of arrayList

I am trying to get the count of duplicate values of String ArrayList, i have achieved the task but not completely. i am able to get the counts of duplicate elements of my arrayList, but the problem is that the order of arrayList destroys when i get…
Muhammad Yawar
  • 424
  • 1
  • 3
  • 19
1
vote
4 answers

random numbers from an array into another array with different occurences rules in java

I need help for an exercice in school. I need to create an array with 6 random integers from the following array : montab[] = {1,2,3,4,5,6,7,8,9,10,25,50,75,100} and with the following rules : numbers 25,50,75,100 can only occur once each in the…
Jeremy
  • 167
  • 11
1
vote
2 answers

My program won't ask the user for an input for an occurrence in a file

So I am making a program that reads from my file and allows the user to enter a word to see the occurrence of the word. It runs properly but doesn't ask the user to enter a word and I'm stuck on why, here's the code: import java.util.*; import…
ant c
  • 81
  • 1
  • 11
1
vote
0 answers

Count of all Text Occurrence within a File

I have a file content of text lines (e.g 9 lines below): 111 AAA AAA EEEE EEEE EEEE EEEE ZZZ1 How can I get the occurrence result of the text line as following using PS? EEEE 4 AAA 2 111 1 ZZZ1 1
YeuSheng
  • 11
  • 2