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
3
votes
4 answers

Long.parseLong("digitstring too significant") produces java.lang.NumberFormatException

I get a java.lang.NumberFormatException: For input string: "1.7023484830876092" trimming the string to 1.70234, does solve the problem, but before slicing the string myself I'm wondering whether its possible to use some java methods to leverage…
dr jerry
  • 9,768
  • 24
  • 79
  • 122
3
votes
1 answer

NodeJS: Convert string X,XXX.XX to float

I'm bothering you because I'm looking to convert a string into a float with node.JS. I have a string that comes back from a request and looks like: x,xxx.xxxx (ex. 4,530.1200) and I'd like to convert it to a float: xxxx.xxxx (or 4530.1200). I've…
Martin Carre
  • 1,157
  • 4
  • 20
  • 42
3
votes
1 answer

Regex for removing single quotes from string except for possessive nouns?

I have the following regex in Java: String regex = "[^\\s\\p{L}\\p{N}]"; Pattern p = Pattern.compile(regex); String phrase = "Time flies: "when you're having fun!" Can't wait, 'until' next summer :)"; String delimited =…
Jimmy Lee
  • 215
  • 2
  • 12
3
votes
6 answers

Problem trying to extract words from string in PHP

I'm trying to extract all words from a string into an array, but i am having some problems with spaces ( ). This is what I do: //Clean data to text only $data = strip_tags($data); $data = htmlentities($data, ENT_QUOTES, 'UTF-8'); $data =…
lejahmie
  • 17,938
  • 16
  • 54
  • 77
3
votes
1 answer

Evaluating mathematical expressions with custom script functions

I am looking for an algorithm or approach to evaluate mathematical expressions that are stated as string. The expression contains mathematical components but also custom functions. I look to implement said algorithm in C#/.Net. I am aware that…
Matt
  • 7,004
  • 11
  • 71
  • 117
3
votes
2 answers

How to access the elapsed time of VLC when paused? - Java subtitle strings parsing program

I'm writing a java program dealing with parsing text from a subtitle file. The idea is, whenever I come across a word in the subtitles that I dont know while playing a movie, I pause the video and open my client, then the client accesses the elapsed…
3
votes
1 answer

Iterating through a std::string c++

I am thinking of a method of how to iterate through a string given by a user. It has to do with a dice rolling; format: xdy[z] where x is times rolled and dy is dice type and z is just an integer The format is this: a number from 1-999 (x), then the…
lucyb
  • 333
  • 5
  • 15
3
votes
1 answer

pass user arg to DESeq2 function

I'm trying to run DESeq in an RScript using parameters input from the command line. I used optparse to parse user arguments and am trying to pass the design argument into the DESeqDataSetFromMatrix() function. I tested the function directly and it…
SummerEla
  • 1,902
  • 3
  • 26
  • 43
3
votes
2 answers

Search folder for files that contain a server name and extension, then select the last modified file, and grab date in the filename

Trying to use VBScript to do this. I have a folder that has multiple files that include the server name with an extention of .vib. All the files show up as servername.vm-T
3
votes
2 answers

String to float/double Parsing

When I try to parse the following string into a float and into a double : String abc = "8.40"; System.out.println("Double Value: " + Double.parseDouble(abc) * 100); System.out.println("Float Value: " + Float.parseFloat(abc) * 100); I get two…
Vijay
  • 558
  • 6
  • 22
3
votes
2 answers

Vala - Equation parsing

I am trying to learn a bit about Vala and wanted to create a Calculator to test how Gtk worked. The problem is that I coded everything around the supposition that there would be a way to parse a string that contained the required operations.…
3
votes
5 answers

How to get the time zone from a datetime string

How can I get the time zone from a datetime string with this format 2013-08-15T13:00:00-07:00?
Fei Qu
  • 999
  • 2
  • 12
  • 26
3
votes
2 answers

Extracting a Date value from a string

Forum. My code reads from an excel file and gets the following string in a variable 'textContainingDate': "Employee Filter: All Employees; Time Entry Dates: 01/07/2016-01/07/2016; Exceptions: All Exceptions" What I would like to do is extract the…
HappyCoding
  • 641
  • 16
  • 36
3
votes
1 answer

rdbuf vs getline vs ">>"

I want to load a map from a text file (If you can come up with whatever else way to load a map to an array, I'm open for anything new). Whats written in the text file is something like this but a bit larger in the scale. 6 6 10 (Nevermind what this…
yukashima huksay
  • 5,834
  • 7
  • 45
  • 78
3
votes
2 answers

How to parse default git date format in C#

How do you parse the default git format to a DateTime in C#? As per What is the format for --date parameter of git commit The default date format from git looks like Mon Jul 3 17:18:43 2006 +0200. Right now I don't have control over the output, this…
Michael Ferris
  • 160
  • 1
  • 2
  • 10