Questions tagged [find-occurrences]

435 questions
0
votes
2 answers

Nth occurence of character in string and get value

I am using the below code to find the nth occurrence of , (comma) in the string. And once I get this, I need to get the value between this occurrence(nth) and next occurrence (n+1th occurrence) Please let me know if I am going wrong somewhere. int…
AngelsandDemons
  • 2,823
  • 13
  • 47
  • 70
0
votes
6 answers

Replace part of a string between the x and x+1 occurrence c#

My code. string sql = "INSERT INTO TABLE1(col1, col2, col3, col4, col5) VALUES (, NULL, NULL, NULL, NULL, NULL,)"; //Insert value for the third column(between the 3rd and 4th comma) Regex rgx = new Regex(@", null"); sql = rgx.Replace(sql, ",…
Misi
  • 748
  • 5
  • 21
  • 46
0
votes
1 answer

Finding partial matches

Say, I have lines like: SOMETHING.AA.AA.DARKSIDE BLaH.AA.AA.Blah I want to find for each line $before = $1; $after = $2; of the $middle = ”AA” Such that for example for line 1 I get: $before= “SOMETHING.” $After = “.AA.DARKSIDE” And…
yurekino
  • 3
  • 1
0
votes
5 answers

Sorting and Organization of letter frequency - python

I'm trying to find a way to count the number of occurrences of letters in a text file than display them in greatest to lowest depending upon there frequency. This is what I have so far, please help get over this brain block. def me(): info=…
Corey Quick
  • 1
  • 1
  • 3
0
votes
1 answer

Count occurrences of values and return them as value_name=>occurences pair

I have a translation table with a column that contains values repeatedly (language name). As following: id | neutral text | language | translation ---+--------------+----------+------------ 0 | SUBMIT | en | Submit 1 | …
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
0
votes
1 answer

Efficient counting of word occurrences in Python

Suppose I have these two tables: Table1: ID CODE DATE value1 value2 text ----------------------------------------------------- 1 13A 2012-05-04 12.0 0.0 null 2 13B 2011-06-08 …
user2578185
  • 417
  • 1
  • 6
  • 10
0
votes
1 answer

MySQL - How to count word occurrences in article titles

I´d like your help to count word occurrences in titles for each 'id' in a MySql table. The table Article and ExpectedResult are available in http://www.sqlfiddle.com/#!9/f985f/1 Thanks in advance.
Romualdo Alves
  • 271
  • 1
  • 2
  • 8
0
votes
1 answer

Matlab: read and calculate percentage of occurrence values from text files

I have a set of .txt files with name: table.iterations.txt where iterations = 1:10000 (so it is table.01.txt, table.02.txt, table.1001.txt etc, each file size is lower than 2kb). Each txt file contains values, integers without decimals in different…
professor
  • 247
  • 3
  • 12
0
votes
4 answers

Counting letter occurrence

The program needs to count and display the number of times that the specified charector appears in the text file. Currently turning up zero for the total. I'm not if I should be using a different loop, I've also tried using a 'for' loop. // Hold…
Kyle
  • 1,153
  • 5
  • 28
  • 56
0
votes
1 answer

Making an Update Query to Count Occurrences

I have a simple question about the SQL of an UPDATE query. I found something very close to what I want to know here: MySQL: Count occurrences of distinct values But.. it's not an update query. Here's the example of what I want to do: In one table…
user2033802
0
votes
3 answers

extract only the first occurrence of the strings

I searched a lot but I didnt find answers which would suit what I am looking for so I am posting this question. I want to extract the first occurance of 'par','comp' 'order' and 'nameprefix'. How to do this for the example input? Is there any perl…
unkaitha
  • 225
  • 1
  • 5
  • 13
0
votes
2 answers

How to find occurances of a string in crystal report?

I am trying to count the total number of (First column closed) Closed records. But I Get the result like 1.00 and 0.00 . Desired results: Code: Local NumberVar str := 0; Local NumberVar strLen := count({@Status}); Local NumberVar i; For i := 1…
Karthik
  • 747
  • 4
  • 21
  • 48
-1
votes
1 answer

How to compute occurrencies of specific value and its percentage for each column based on condition pandas dataframe?

I have the following dataframe df, in which I highlighted in green the cells with values of interest: enter image description here and I would like to obtain for each columns (therefore by considering the whole dataframe) the following statistics:…
-1
votes
1 answer

Count the number of items in a list that correspond with a key in a dictionary in python

Good morning/evening, thank you for taking the time to read this. I'm a beginner at programming and as part of a coding bootcamp project, I have to create a program to extract data from two .txt files in python, a file with 'user' data and a file…
-1
votes
1 answer

creating an list of occurence dataframes (two sided matrix) in R

My original Dataframe looks like A <- data.frame(Actor1 = c("A1", "B2", "C3", "D4"), Actor2 = c("A1", "C4", "F2", "B2"), Dates = as.Date(c('1999/01/01', "1999/02/05", "1999/05/06", "2000/03/06")), Case = c(4, 6, 8,…
Sulz
  • 333
  • 1
  • 8