Questions tagged [find-occurrences]
435 questions
0
votes
1 answer
How to keep column headers when using grep?
The output of some programs start with column names (e.g., ps a):
$ ps a
PID TTY STAT TIME COMMAND
1306 tty1 Ss+ 0:00 /sbin/mingetty /dev/tty1
1318 hvc0 Ss+ 0:00 /sbin/agetty hvc0 38400 vt100-nav
14696 pts/0 Ss 0:00…

Bas Peeters
- 3,269
- 4
- 33
- 49
0
votes
1 answer
How to find multiple occurrences of integers in a linked list
I'm having trouble figuring out an algorithm that will help me find multiple occurrences of integers in a linked list

Supermanawl
- 1
- 1
- 2
0
votes
0 answers
C++ Occurrences of a number in an array of int
I am struggling with my code for finding occurrences of a number in an array. If a user provides 1230476 and 10034850 as their two integers, it should show that for even digits, the largest occurrence is 0 and number of occurrences is 4, and the…

JRags
- 13
- 5
0
votes
1 answer
find and replace occurrence with wchar_t
I need to develop a small function to find occurrence in a wchar_t sequence of character. this function take as input the the pointer wchar_t* to a string, but as it's unicode the value of every single character is displayed as a number…

UncleSax
- 148
- 2
- 16
0
votes
2 answers
Single occurrence of a number
For this question, "Given an array where every element occurs three times, except one element which occurs only once. Find the element that occurs once. "
I tried the code given at…

GBSE
- 17
- 2
0
votes
2 answers
Excel-VBA: Count occurrencies of a different strings and list them
Today I have the following problem: I have 2 columns of x rows (doesn't matter how many) in Excel with a string in each one, like this
A B
Apple Potato
Banana Potato
Apple Potato
Orange …

Noldor130884
- 974
- 2
- 16
- 40
0
votes
2 answers
How to count duplicate elements in a vector using R
I need to write a function that receives 2 arguments in R:
first a number = X
second a vector = V
I need that this function would return the max number of the identical straight occurrences of X
for example:
f(6, c(7,6,6,3,7,9,3,6,6,6,8,9)
should…

user3581800
- 317
- 2
- 5
- 16
0
votes
2 answers
Count number of occurences group by
I need to count the number of times each occurence appear, not only 'group by' which I make with sort:
>>> cat /var/log/squid/access.log* | awk '{ print $NF }' | sort…

Olivier Pons
- 15,363
- 26
- 117
- 213
0
votes
1 answer
Java Regex to find if a given String contains a set of characters in the same order of their occurrence.
We need Java Regex to find if a given String contains a set of characters in the same order of their occurrence.
E.g. if the given String is "TYPEWRITER",
the following strings should return a match:
"YERT", "TWRR" & "PEWRR" (character by…
0
votes
2 answers
How to count the occurence of a column which is the result of a concatenation of a string and integer
The data in my table looks like this:
AUDTORG | SEQUENCENO | LINE | REFERENCE | AMOUNT |
--------------------------------------------------
ADX | 1 | 422 | Wire1 | 10 |
ADX | 2 | 385 | Wire2 | 10 |…

Seva
- 57
- 10
0
votes
1 answer
Data structure for occurrence counting in long tail distribution
I have a big list of elements (tens of millions).
I am trying to count the number of occurrence of several subset of these elements.
The occurrence distribution is long-tailed.
The data structure currently looks like this (in an OCaml-ish…

Johan Mazel
- 33
- 4
0
votes
1 answer
getting occurrence of values according to a condition
before posting this question I have searched for something similar across several questions, but I wasn't able to find what I am looking for.
If this post is a duplicated, well I apologize and I will appreciated if you can forward me to the right…

stefano
- 601
- 1
- 8
- 14
0
votes
1 answer
Is it possible to do a test of significance for a string occurrence in two datasets in Python
I have two sets of data both compiled from different sources. Both set of data contains word with a frequency of occurrence. I would like to check if a certain word exists in both dataset and if they do, is it possible to perform some kind of test…

Cryssie
- 3,047
- 10
- 54
- 81
0
votes
4 answers
how to find occurrence in List/ArrayList
I have a question on how to find the number of occurrences in a list. In my case, for part of my program, I am trying to find the number of occurrences of 1, 2, 3, and 4's of a hurricane category and displaying them. I tried using a for loop and an…

user2967353
- 257
- 3
- 9
- 18
0
votes
3 answers
Remove multiple occurrence except for particular values?
I have a list of lines of text: textlines which is a list of strings (ending with '\n').
I would like to remove multiple occurence of lines, excluding those that contains only spaces, line feeds and tabs.
In other words, if the original list…

Vincent
- 57,703
- 61
- 205
- 388