Questions tagged [string-parsing]

The action of retrieving data from a string

String parsing is the action of extracting or modifying data pieces from a string. For example, one might parse a string to remove all quotation marks or to find all items inside quotation marks.

970 questions
5
votes
2 answers

Parse date time from string of format ddMMMyyyy hhmm (with Month-Name)

I am kind of stuck with an issue where I am unable to to parse the date and time from a string, which I am reading from a text file. The string I am getting is in following format: 05SEP1998 2400 and I am trying to parse the string through the…
Pankaj
  • 259
  • 3
  • 16
5
votes
2 answers

Search string for numbers

I have a javascript chat bot where a person can type into an input box any question they like and hope to get an accurate answer. I can do this but I know I'm going about this all wrong because I don't know what position the number will appear in…
mister movie
  • 103
  • 1
  • 10
5
votes
5 answers

Is there a tool for parsing a string to create a C# func?

I need to know if there is any library out there that will allow me to, given a certain string representing a mathematical function, say, x^2+x+1, (don't care about how the string format, any will work for me) generates a C# func that will represent…
user1432653
  • 109
  • 1
  • 6
4
votes
2 answers

How to remove unbalanced/unpartnered double quotes (in Java)

I thought to share this relatively smart problem with everyone here. I am trying to remove unbalanced/unpaired double-quotes from a string. My work is in progress, I might be close to a solution. But, I didn't get a working solution yet. I am not…
Watt
  • 3,118
  • 14
  • 54
  • 85
4
votes
2 answers

Documentum DQL: How can I get UTC time zone for Date columns to parse to .NET?

Documentum (DQL via DFC) always returns Date result columns as a string formatted like this: Wed Oct 19 16:01:59 PDT 2011 ...and the .NET DateTime.Parse function chokes on this — especially the PDT time zone (TZ henceforth) part of the strings —…
Scott Baker
  • 10,013
  • 17
  • 56
  • 102
4
votes
3 answers

Parsing number from string

How do I split selected value, seperate the number from text in jQuery? Example: myselect contains c4 Just get only the number 4. $('select#myselect').selectToUISlider({ sliderOptions: { stop: function(e,ui) { var…
user683742
  • 80
  • 2
  • 8
4
votes
1 answer

Implementing T9 text prediction

I have a T9 dictionary in memory (trie/hash_map). The dictionary contains word-rating pairs, so when a word is picked from dictionary, its rating increments, and the word-rating pair goes up in the word list. Let's say that there is a method to…
sashab
  • 1,534
  • 2
  • 19
  • 36
4
votes
2 answers

Reading two inputs from the user

I would like to get the user enters two different values using only ONE statement of Console.ReadLine(). More specifically, instead of using two different variables declarations with two different ReadLine() method - I want to let the user enters…
Sinan
  • 453
  • 2
  • 10
  • 20
4
votes
6 answers

Extract Numeric and Special Characters Separately

I have column in a table with values stored as Cost 499.00 £ 7.75 £ 7.75 250.00 £ 5.99 $ 6.05 Now, I need to store these values to another table like Currency Cost RS 499.00 £ 7.75 £ 7.75 RS 250.00 £…
4
votes
1 answer

Using TO_NUMBER to parse numbers both in fixed notation and scientific notation

Using Oracle SQL, how can I convert string to a number when the string (a VARCHAR2 column) can contain either: a number in fixed notation, such as -11.496606820938826 SELECT TO_NUMBER('-11.496606820938826', '999.999999999999999999',…
Danilo Piazzalunga
  • 7,590
  • 5
  • 49
  • 75
4
votes
5 answers

Efficiently split a string in format "{ {}, {}, ...}"

I have a string in the following format. string instance = "{112,This is the first day 23/12/2009},{132,This is the second day 24/12/2009}" private void parsestring(string input) { string[] tokens = input.Split(','); // I thought this would…
Analia
  • 83
  • 1
  • 11
4
votes
1 answer

Simple (mostly) variable parser

In one of my projects, I need to be able to provide a very simple variable find-and-replace parser (mostly for use in paths). Variables are used primarily during startup and occasionally to access files (not the program's primary function, just…
ssube
  • 47,010
  • 7
  • 103
  • 140
4
votes
2 answers

How can I parse a bytestring in Python 3?

Basically, I have two bytestrings in a single line like this: b'\xe0\xa6\xb8\xe0\xa6\x96 - \xe0\xa6\xb6\xe0\xa6\x96\n' This is a Unicode string that I'm importing from an online file using urllib, and I want to compare the individual bytestrings so…
srdg
  • 585
  • 1
  • 4
  • 15
4
votes
0 answers

Python data scraping from string

I have lines of text containing multiple variables which correspond to a specific entry. I have been trying to use regular expressions, such as the one below, with mixed success (lines are quite standardised but do contain typos and…
4
votes
3 answers

Subset Columns based on partial matching of column names in the same data frame

I would like to understand how to subset multiple columns from same data frame by matching the first 5 letters of the column names with each other and if they are equal then subset it and store it in a new variable. Here is a small explanation of my…
WaterRocket8236
  • 1,442
  • 1
  • 17
  • 27