Questions tagged [parsing]

Parsing refers to breaking an artifact into its constituent elements and capturing the relationship between those elements. This tag isn't for questions about the hosted service Parse.com (use [parse.com]) or parse errors in a particular programming language (use the appropriate language tag instead)...

0
votes
0answers
6 views

Parse exception for Timestamp in Android (Invalid time zone indicator 0)

I am working with REST service on Android with Retrofit lib. I am sending a request, and the response should include this model: public class User implements Parcelable, Cloneable{ @SerializedName("...
0
votes
0answers
15 views

Latex algorithm antlr grammar?

is there a grammar available for ANTLR to parse the output of latex algorithms? not the actual latex language but the "pseudocode" output. an example would be the "pseudocode" generated from latex ...
0
votes
1answer
13 views

How to iterate through Elementtree using namespaces

I have been trying to parse through an xml document using ElementTree in python to modify one of the elements, however I keep running into issues due to namespaces. I can get all the tags from my ...
0
votes
0answers
38 views

Trouble Parsing NMEA in C function strtok [duplicate]

I'm having some troubles parsing an NMEA string. Sometimes I have data in a position and sometimes I have not. When I have not, I have 2 null slots; the function strtok ignores that position. Here ...
0
votes
1answer
40 views

Is it possible to reconstruct a delegate from a string? c# .NET Core

I am trying to make a pair of programs in C# .NET Core one of which generates "templates" or "rules" in a form of text (XML, JSON, etc.) and the other translates it to code to be run. This is still at ...
0
votes
1answer
31 views

Complicated Json parsing in java [duplicate]

i want to parse this code to get the id's location in an array. Json is as follows: "tipSecurableSet": { "id": "082bdd09-6cff-41f9-a6f6-16a5bcc2eaa6", "items": [ ...
1
vote
3answers
16 views

python parsing xml to fetch string greater than given value

How to parse through xml file using python, where i'm trying to get get "score" greater than 50 if exits. In my xml file, it does exists, it should print out 65,93. Test.xml <analysis ...
0
votes
0answers
13 views

Parsing block comments with javacc

I'm trying to write some javacc grammar to parse a file that contains multi-line comments, for example, the following are all valid: /**/ /* */ /* This is a comment */ /* This is a multiline ...
1
vote
3answers
31 views

PHP DOMDocument XML

I have a php variable like this: <div class="classA"> <a id="someID1"></a> <div class="class1"> <div class="class2"> <div class="class3"> ...
-6
votes
1answer
57 views

haskell recursive descent parser

How can i create a recursive decent parser without the use of parsec or any library, for this grammar? The output should be an error message if the string does not belong in this grammar? parse::...
1
vote
1answer
26 views

Fetch information from DBPedia service

I am able to get a JSON version of dbpedia resource as below : http://dbpedia.org/data/Influenza.json But I am not able to parse it and pull desired result, Abstract and ICD code using JSON to Object ...
-4
votes
0answers
14 views

Advanced Javascript Parsing - Extracting Text [duplicate]

Say for example I have the following body of text: /*Comments here*/ Code here /*Comments here Comments here Comments here*/ Code here //Comments here How could I parse this in a way to extract only ...
0
votes
0answers
17 views

How to create a parser for optional words in a CFG with different case classes

I have a CFG production which is : let: "let" "var"? idn "=" exp So it allows grammers like let a = 3 or let var t = 2 I also have 2 case classes, one with var and one without var case class ...
0
votes
0answers
14 views

How to prove that the grammar G is not LL(1)

The grammar is: L => LE | E E => (C) | (F) | V | T C => ifEE | ifEEE F => +L | -L | *L | printL V => a | b | c | d T => 0 | 1 | 2 | 3 I think it is not LL(1) because of C => ifEE | ...
1
vote
5answers
34 views

Python can't parse JSON with extra trailing comma

This code: import json s = '{ "key1": "value1", "key2": "value2", }' json.loads(s) produces this error in Python 2: ValueError: Expecting property name: line 1 column 16 (char 15) Similar result ...
0
votes
0answers
2 views

how to solve error when consuming ws nosuap?

I have a problem when I consume a nosupa in php 7, I have the following error XML error parsing SOAP payload on line 1: Invalid document end
-2
votes
1answer
23 views

How to read multi url-encoded text by reqparse.parser in python

I am using python (flask) for reading input from command line using following code but when i pass url-encoded strings(multi arguments seperated with space) as input it gets merged to single sting ...
0
votes
1answer
21 views

Python argparse: Leading dash in argument

I'm using Python's argparse module to parse command line arguments. Consider the following simplified example, # File test.py import argparse parser = argparse.ArgumentParser() parser.add_argument('-...
-1
votes
2answers
19 views

How to load a Json that doesn't have types?

I have a Json file that looks like the one below. Usually I am lucky enough to get Json that has objects and primitive types which makes it very easy to load into an object. In this case the Json is ...
0
votes
1answer
25 views

Wrote a grammar and created everything using ANTLR, trying to figure out how to link this to a Java program

So I have a grammar that I created and compiled and everything for Java in ANTLR. The parser does work correctly and can verify that statements written in the grammar are correct. Now I am trying to ...
-1
votes
1answer
18 views

Recover list format when passing an argument [duplicate]

I am passing as argument to a python program a list of two strings (in particular to stream geo located tweets from python-twitter). The format is as example: my_python_program.py -l ['-9.215752,...
3
votes
3answers
50 views

Having trouble parsing HTML with PHP and Simple HTML DOM

I am in the process of trying to parse HTML with simple_html_dom.php. The HTML I am trying to parse is shown below. I can successfully grab each product name: Product 1, Product 2, Product 3, etc. ...
0
votes
0answers
6 views

Skip reading historical data while parsing logs

i am reading my logs from s3 bucket, bucket contains data from the month of Jan , when i am running my configuration , logstash is reading all historical data , but i want to read only todays data , ...
-1
votes
0answers
26 views

how to parse json with dynamic key in response

I want to parse json response which has a defined structure but some properties are dynamic and due to this i can not create model class for json. How can i parse this dynamic json response. In my ...
0
votes
2answers
70 views

How can I parse multiline records in Perl?

I'm trying to parse the string that use delimiter '#' this string has 3 lines 101#Introduction to the Professor#SG_FEEL#QUE_NOIMAGE# head up to the Great Hall and speak to the professor to check in ...
1
vote
0answers
37 views

How can I generate a JSON file from this HTML unsorted list?

I am trying to generate a json file for the index of this page, which is an unsorted list. It has to include hierarchy. This is the code that I currently have: def parse_list(self, tag): lis ...
-5
votes
0answers
48 views

i need help splitting a string into parts

basically i need to split a string into specific lengths. and the length is 2. i feel like a loop of some sort would be helpful but can seem to figure it out example "hello i need help with this ...
0
votes
1answer
50 views

How can I convert JSON (from google-trends-api) to CSV?

I've been trying to use the javascript google-trends-api from npmjs.com to automate retrieval of search trend data. I'm successful in getting the raw JSON output from my queries, but I can't seem to ...
0
votes
0answers
32 views

Can't parse Date with Univocity parser [duplicate]

Im using univocity for parsing csv file. But I cant parse date in String format to java.util.Date. It seems like the @Format(formats ="YYYY-MM-DD") annotation is not working. Im trying parse line ...
0
votes
1answer
15 views

Parse ISO 8601 microseconds in Typescript

I need to parse timestamp in ISO 8601 with microseconds. I do not want to lose the precision. I require the parsing in order to be able to add filtering to queries. A database that supports ...
0
votes
1answer
14 views

Get xmllint xpath soap

I need to parse that xml: <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Header/> <soap:Body> <m:runResponse xmlns:m="http://www"> ...
1
vote
2answers
23 views

How I pass argument as index to jq?

Hi I would like to access a given element in the json array as below: $ echo '[ { "CT" : "OS1" , "VERSION" : "3" } , { "CT" : "OS2" , "VERSION" : "3" } ]' | jq '.[1]' { "CT": "OS2", "VERSION":...
0
votes
1answer
42 views

Perl get the site path

I want to knew how to parse the path from a site ex : http://example.org/hello/ok/fl.jpg is there a way to parse this part (path) /hello/ok/
1
vote
0answers
15 views

Problems when parsing headers from Apple Mail sent emails

I got an Python script that parses emails and extracts various things like headers, SHA's of attachments and such. This works most of the time but I have recently ran into a weird thing. If the ...
1
vote
2answers
30 views

Python: How to parse data from text file to 2 Dimensional list/array

I have data like this stored in a text file: ABC,0x1: XYZ,0x2: I want to parse this data into 2 dimensional array, currently i can parse data separated by ':' using following code, text_file = ...
0
votes
0answers
24 views

Parsing strings to different data types according to string content

I'm writing a script who's usage has several optional arguments, collected into a kwargs dictionary. Some of these arguments are strings, some are integers/floats and some are tuples (entered in the ...
-4
votes
0answers
14 views

Parse error: syntax error, unexpected 'private' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) [duplicate]

my first post here i'm creating a mvc project in php for school and ive been on this error for a few time now and i dont know what it is, i know where it is, but i dont understand what makes it wrong....
1
vote
2answers
32 views

How to read csv file without header using opencsv?

I do know the header, but the header is parsed separately. I am using a pojo with annotations and setting it as type. My code looks like this: CsvToBean<MyObject> bb = new CsvToBeanBuilder<...
-1
votes
1answer
37 views

Python searching for particular child of child

I am trying to download xml data (which I have done) parse it (which I have done) and search through xml data to return a result. <Substances> <Name>Substance 1</Name> <Product&...
1
vote
1answer
31 views

Parsing Entire AWS SQS Record using GSON

I have been trying unsuccessfully now to parse this message. Using the AWS Simple Queue Service API, I follow instructions and do the following... for(Message m : Messages){ System.out.println(m....
1
vote
0answers
25 views

How parse site after loading javascripts with Java

Hello i need get video url from site with parsing from json. But i can't get video with tag because it creting with javascript. <script>var player = jwplayer('player-embed'); player.setup(...
0
votes
2answers
38 views

Get Abstract Syntax tree for Java method using JDT Eclipse

I'm working on a project that must use Eclipse JDT for parsing java methods and generating Abstract Syntax tree for them I wrote the following code : String method ="\n"+ " public void sayHello(...
0
votes
3answers
64 views

Parsing a string like “03/2020” to a DateTime variable

I have to parse a string, which always look like 03/2020 (so the format is MM/yyyy), to a DateTime variable. How do I achieve it the most proper way? (Without splitting the string into substrings) I ...
0
votes
1answer
35 views

Parsing XML/HTML with PHP

Hey I've got an XML like this in a php variable: <tbody> <tr> <td><b>Data1</b></td> <td> ...
-2
votes
1answer
54 views

PHP HTML Parsing [duplicate]

Hey I'm new to html and php I have a variable in php which is a html source code: inside this source code there is a table tag with a specific class name like this: $html = '<html>... <...
1
vote
0answers
22 views

Superpower parser for balanced nested parentheses

I'm struggling to come up with a superpower parser for the set of partial inputs below (nested, balanced parentheses with '|' separator). This is a part of a larger language, thus the set of tokens ...
-2
votes
0answers
26 views

Add element to xml tree and save it to the existing root

Is there a way that I can append an element to some child node and then save that change in the original root without having to write out the changes to another xml file and reading in that again? I ...
0
votes
0answers
17 views

inflator overlaps when added in relative layout

When I tried to add inflator view in the loop it overlap over each other is there any I can break two list. I want this type of view list of names along with image(1 to 4) grid layout list of names ...
0
votes
0answers
25 views

Jsoup can't find video in webpage

I want get vide tag after get src . But when i parsing with jsoup, its can't find it. Webpage placing where mix.tj/video/113989.html from this code i pars site class Loading extends AsyncTask<...
0
votes
1answer
33 views

Parse JSON for first instance of repeated data field in Java with org.JSON

I'm trying to parse the first instance of "actualEPS" from the following JSON file: {"symbol":"AAPL","earnings":[{"actualEPS":2.34,"consensusEPS":2.17,"estimatedEPS":2.17,"announceTime":"AMC","...