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
-1
votes
5 answers

Interview test: Implement a decoding algorithm

I got this problem in Amazon interview. Given have a String in Java as input 3[a]2[bc] write a function to decode it so the output should be as "**aaabcbc**" Input 3[a]2[bc] -> aaabcbc Input 3[2[a]]4[b] -> aaaaabbbb Invalid Input 3[4] `enter code…
-1
votes
2 answers

Parse data from a memo SQL

So basically I have several memos in a DB. I need to query through them and only grab each note in the memo that has a date before it. So if I had this for example: abc def ghi jkl 9/1/17: mno pqr I would only want to Grab the 9/1/17: mno pqr…
Matt Synco
  • 15
  • 5
-1
votes
5 answers

Replace specific characters in a string without using replace method in Java

I'm not allowed to use the replace() method and I basically have to have a part of my program that does this: -Ask the user to type in a sentence to be manipulated. -Then ask the user to enter which character to be replaced (i.e. "e" from…
David -
  • 41
  • 2
  • 4
-1
votes
1 answer

C - string to uint64_t casting with error handling

This program is to cast strings to uint64_t types and get the errors if any. It should output, in this case, 2 errors (overflow and negative number), none of which appear. Also, it doesn't properly cast one of the strings. Any help would be…
PyCV
  • 315
  • 2
  • 11
-1
votes
2 answers

Python: parsing a string of concatenated ascending integers

The objective is to parse the output of an ill-behaving program which concatenates a list of numbers, e.g., 3, 4, 5, into a string "345", without any non-number separating the numbers. I also know that the list is sorted in ascending order. I came…
peterlin
  • 127
  • 1
  • 4
-1
votes
1 answer

import csv in array's, explode text file by datevalue given or by numrows possible?

I have a csv file which Contains Trace Signals of Vibration Data. Its Starts with an ISO 8601 Date 2017-01-31T16:16:21.000+01:00 then it have 1024 rows of data(512Hz 2Sec Signal). And then the next Trace signal which starts with the new Date but in…
Van De Wack
  • 92
  • 1
  • 9
-1
votes
2 answers

Select elements from a character vector with strsplit

I have a character vector which looks like this: chars <- c("Classics football boots", "Classics football shoes","football shoes", "new footbal shoes") In this chars object i want to select only elements football shoes & football boots. With…
Sander Van der Zeeuw
  • 1,092
  • 1
  • 13
  • 35
-1
votes
3 answers

Extract the string from string in Java

I have this string in Java: String str = "-High Upload Observed|High| eventId=285475664495 MMTT type=2 mrt=1482650158658 in=104858769 out=104858769 sessionId=0 generatorID=3+ACVIFkBABCAA951mZ0UyA\=\= modelConfidence=0 severity=0"; From the above…
Mohan M
  • 115
  • 2
  • 9
-1
votes
1 answer

How to parse this .js file into an xml file using regex in c#?

//testing.js file describe('Criteria and Adjustment Section', function () { it('the labels should have correct spellings -Expected result- the labels have correct spellings', function () { //some logic }); describe('Test 1', function () { …
P. H. Nabila
  • 45
  • 2
  • 6
-1
votes
5 answers

parse string to JSON by javascript or JQUERY?

My string looks like this one below. But while converting it to JSON by javascript/jQuery the error is received "Invalid Charater". Please help '[{ color: "#8B0000", data: [{ "y": 12000, "x": 0}], pointRange: 8, type: "column", name:…
Monsta
  • 59
  • 3
  • 7
-1
votes
2 answers

Handle number in string PHP

I have a text area, it include string and number. I want to sum 3 record into a text like this I try to show you my stack, hope you can help me. Thank you!
XCode2015
  • 193
  • 1
  • 2
  • 10
-1
votes
2 answers

Address formatting using regex - add state before zip code

I have an address formatted like this: street address, town zip I need to add the state abbreviation before the zip, which is always 5 digits. I think I should use regex to do something like below, but I don't know how to finish it: instr = "123…
pekasus
  • 626
  • 2
  • 7
  • 20
-1
votes
2 answers

How get the some numbers from the string

I have this string "9X1X121: 1001, 1YXY2121: 2001, Role: ZZZZz" and need to get the numbers from the input string. String input = "9X1X121: 1001, 1YXY2121: 2001, Role: ZZZZz"; String[] part =…
Prabhakaran Ramaswamy
  • 25,706
  • 10
  • 57
  • 64
-1
votes
1 answer

python: how to parse string of values like "a = 'abc' b = 'cde' c=13"

Basically if I have a string like "a = 'abc' b = 'cde' c=13", how can I parse it into a dictionary like: {'a': 'abc', 'b': 'cde', 'c': 13} Note that the values can be string literals or numbers, and the string literals can contain equals signs…
kelvinsong
  • 218
  • 1
  • 7
-1
votes
1 answer

Parsing a MAC Address to an array of three 16-bit shorts

MAC Addresses are 48 bits. That is equivalent to three shorts. MAC addresses are sometimes written like this: 01:23:45:67:89:ab where each pair of digits represents a hexadecimal number. Write a function that will take in a character pointer…
user4567366