Join us in building a kind, collaborative learning community via our updated Code of Conduct.

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)...

1
vote
1answer
22 views

Update files insite Jar file

Basically I have a Jar file capable of parsing Java files and do some calculations based on the parsed values. The problem is that the grammar in this Jar is old and only supports version 1.5 of Java....
0
votes
0answers
8 views

encoding HTML error with scrapy 1.5.1 in python

So, I am scraping data from webpages in Python 3.6. After receiving the response there seems to be an error in the encoding when I try to output the data to a file. class ExampleSpider(scrapy.Spider):...
1
vote
1answer
13 views

Complex XML Parsing in R

I am trying to parsing a xml file that is nested. <GENERIC_ROUGHDRAFT> <HEADER compName="California" dateCreated="2018-08-07"> <COMP_INFO> </HEADER> <...
0
votes
0answers
8 views

self.scan_once(s, idx) json.decoder.JSONDecodeError: Expecting ','

I have a large json file (2.4 GB). I want to parse it in python. The data looks like the following: [ { "host": "a.com", "ip": "1.2.2.3", "port": 8 }, { "host": "b.com", "ip": "2.5.0.4", "...
-1
votes
1answer
24 views

“/usr/lib/python3.6/json/init.py”, line 296, in load return loads(fp.read(), MemoryError

I have a large json file (2.4 GB). I want to parse it in python. The data looks like the following: [ { "host": "a.com", "ip": "1.2.2.3", "port": 8 }, { "host": "b.com", "ip": "2.5.0.4", "...
0
votes
1answer
31 views

Scala find horizontal and vertical words when given a map of symbols and their positions

I'm currently working on reading data in functional programming. I'm given a Map[Vec2, Char] and i have to extract horizontal and vertical words. Coordinates start at top left side. Example input ...
5
votes
0answers
47 views

Perl6 : What is the best way for dealing with very big files?

Last week I decided to give a try to Perl6 and started to reimplement one of my program. I have to say, Perl6 is so the easy for object programming, an aspect very painfull to me in Perl5. My ...
1
vote
2answers
30 views

How to parse decimal and hexadecimal string depending on number format to int

How do I parse a string with either a decimal number like 1234 or hexadecimal number prefixed with 0X1234 to an int in C#? I have tried int.TryParseand Convert.ToInt32 But it seems like these ...
0
votes
1answer
45 views

How to parse a htm file using Beautiful soup

I am trying to parse a htm local file using BeautifulSoup. .htm is filetype. from bs4 import BeautifulSoup with open('locfile.htm') as fp: soup = BeautifulSoup(fp, "html5lib") print(soup) ...
0
votes
0answers
21 views

Parse XML Data to Array of Dictionaries & Display in TableView

I have been trying to load my Parsed XML data to a table for the past two days. I have had success with parsing the data and displaying it in the console. However, I have not been able to load the ...
3
votes
2answers
37 views

Are both comma and colon redundant for JSON parser?

JSON I mentioned below is valid JSON. I finished writing a parser of JSON which allowing only two basic data types of String and Object. Let me show what parser does in case of any ambiguity. parse("...
0
votes
3answers
46 views

Python script to remove erroneous characters from a CSV file

I have an automatically generated CSV file which provides the data I need, but some individual cells have extra characters in the cell. COLUMN1 COLUMN2 COLUMN3 'Foo325GoodData' ...
-4
votes
2answers
37 views

Javascript Json object to object with keys of dotted strings [on hold]

I need to parse Json response { "product": "office", "info": { "brand": [ "1brand" ], "detail": { "number": { "min": 1, ...
-1
votes
0answers
26 views

Parsing tokens in a custom language from scratch

I've been trying to implement a simple programming language in Python. So far, I've created a functional lexical analyser that returns to me a list of tokens with the text in the input file that ...
1
vote
1answer
35 views

Parse a String (of array of strings) in JSON to an array of Strings in Swift

Does Swift provide a way to convert a raw String like this "[\"John\",\"Anna\",\"Tom\"]" to an Array of strings ([String])? I've looked for a way to do it over StackOverflow, but in that specific ...
0
votes
1answer
35 views

How to get all links in HTML and CSS

I have an HTML page in an iframe that is provided by a user. I want to have a list of all urls referenced in this HTML page anywhere. This includes links in CSS files and in style attributes. For ...
1
vote
1answer
62 views

Detect struct fields access in C

I want to force that a certain struct never gets it's fields accessed directly, always using the struct functions. Example: struct NoOutsideAccess { int field1;} struct example {NoOutsideAccess f1;} ...
1
vote
0answers
25 views

Strange parsing json to xml in javascript

I have a strange problem. I work with nodeJS and I want to parse json to XML, then send it to remote WebService. So: 1. Download 'soap' and 'js2xmlparser' via npm 2. Create Client: function ...
-1
votes
0answers
17 views

Parsing vehicle routing problems from TSPlib95

I am trying to parse some problems from TSPLib95. My question is about problems that have EDGE_WEIGHT_TYPE : EXPLICIT and EDGE_WEIGHT_FORMAT: LOWER_DIAG_ROW. For example the problem eil7 gives this ...
0
votes
1answer
37 views

Backward compatibility on parsing by means of FParsec

Imagine that I have simple string (in reality this string can contains much complex items like digit combination, Guid etc...): "a, b, c" and appropriate parser which works great with it. Then after ...
0
votes
1answer
63 views

How does p >>= f works in Parser instance?

class Monad m where return :: a -> m a (>>=) :: m a -> (a -> m b) -> m b instance Monad Parser where return a = Parser (\cs -> [(a,cs)]) p >>= f = Parser (\...
0
votes
1answer
29 views

Jackson JSON check values before adding them to list

Code snippet: ObjectMapper objectMapper = new ObjectMapper(); try { this.persons = objectMapper.readValue(new File(fileName), new TypeReference<...
0
votes
2answers
51 views

Parse python nested list from string

So I parse a file to a python lists and I encountered a nested list like this: { 1 4{ 2a 0.0 }{ 3 0.0 }{ 4c 0.0 }{ 5 0.0 } } I want to interpret it as a list, yet nested, so I want ...
-4
votes
2answers
73 views

Python Regex for XML like data string

I have a string like so: s = '"<w s=\'<v1>\'><m><v2>v3</m><v name='x'><v4></v></w>"' The the single quotes around attribute s of node w, have to ...
-2
votes
1answer
19 views

Issue with parsing json into Python and filtering on key

I hope somebody can point me in the right direction. I'm relatively new to Python. I'm using an open Ergast API and am trying to import/parse a json file and filter on some of the elements. I can ...
2
votes
4answers
49 views

Accessing JSON values when parsing

I have a file called persons.json: [ { "id": 1, "name": "The Best", "email": "thenextbigthing@gmail.com", "birthDate": "1981-11-23" }, { "id": 2, "name": "Andy Jr.", ...
2
votes
1answer
36 views

What concepts or algorithms exist for parallelizing parsers?

It seems easy to parallelize parsers for large amounts of input data that is already given in a split format, e.g. a large list of individual database entries, or is easy to split by a fast ...
0
votes
0answers
22 views

Is there a way in `lxml` to skip irrelevant branches when parsing

I am attempting to parse small amounts of data from a large XML file (2G). For small files I would just use root_node.xpath('/the/specific/path/i/am/interested/in') but I have read that this is ...
0
votes
0answers
21 views

How to parse command containing equal sign in batch file

I need to parse an url that containing equal sign to a program. The urls are in a text file one per line basis. Here's my code: SETLOCAL ENABLEDELAYEDEXPANSION SET input=%* Input is a text file ...
0
votes
0answers
8 views

Is there any way easy parse HTML document via php or node js?

I have files with HTML code, it`s different documents. My task is load it and parse, I need replace some tags, change tags values (styles and etc). What better to use ? Is it possible do it via node ...
-5
votes
2answers
54 views

Split my string as per specific requirement

I have written a small method that extracts certain information from a string. An example of such a string is "Author: rajdra1 Subject: Sticky Note Date: 09-08-2018 11:06:56" Now I need certain ...
1
vote
2answers
30 views

Parse Nested JSON Array and put it in a Model class using Dart Language

In relation to my question here I want to parse a JSON array without a key within JSON array and put it in a Model class. here is a JSON Array that I want to parse. [ { "pk": 100, ...
0
votes
1answer
16 views

getPrettyFormat() not working with some SVG images in Google Apps Script

I need some help finding out why some SVG images when formatted with getPrettyFormat() look as expected and some others seemed not getting the pretty format. First I extract the files from Drive and ...
0
votes
3answers
46 views

String or double to byte

I have a problem. I receive a double val=80.22. Then I split it: String[] arr=String.valueOf(val).split("\\."); int[] intArr=new int[2]; intArr[0]=Integer.parseInt(arr[0]); // 80 intArr[1]=Integer....
0
votes
1answer
23 views

python print last element value in XML

Using ElementTree, I have gone through a ton of post here and can't find any that are specific to my xml. I want to return the last timestamp in the example xml below <?xml version="1.0" encoding=...
-2
votes
0answers
29 views

the issue goes“Parse error: syntax error, unexpected ';', expecting ',' or ')'”,please check if there are any issues? [duplicate]

//insert your values $query = mysqli_query($conn,"INSERT INTO `mytable`(ID,FULLNAME,EMAIL,PHONE) VALUES ('";$thename;"','";$themail;"','";$thephone;"')"); //check your insert!! if (!$query) {...
0
votes
2answers
41 views

CSV parsing returns “Unquoted fields do not allow \r or \n” but can't find error in source file?

I'm using the built-in CSV function in Ruby for my Rails app. I am calling a URL (via HTTParty) parsing it, and attempting to save the results to my database. The problem is, I'm getting the error ...
0
votes
1answer
46 views

Parsing Just Time to get difference

I am trying to simplify my life parsing logs and gathering times. I get a file with the log statements that all start with the time stamp in this format 16:08:39.660 I want to turn this string into ...
1
vote
1answer
54 views

JNA How to wrap interface written in C++

I already know how to wrap an Structure , but I need some help with interfaces. The interface I want to wrap is the IImageList. But I have now clue how to create an java class out of it SOLUTION: ...
0
votes
1answer
47 views

Parsing JSON without the table name

I'm trying to parse a database using JSON. But, I don't know how to parse a JSON file to get the name and value of the table without the need to declare the table's name preloaded for(int i=0;i<...
-3
votes
0answers
10 views

how to decoding following a nested array in swift 4 .I want to parse image [on hold]

how to decoding following a nested array in swift 4 .I want to parse image
0
votes
2answers
39 views

XPath for span and div

<div id="buyNewSection" class="rbbHeader dp-accordion-row"> <h5> <div class="a-row"> <div class="a-column a-span4 a-text-left a-nowrap"> <span class="a-text-bold"...
0
votes
1answer
15 views

ElasticSearch Mapper Parsing Exception while insertion of data

https://pastebin.com/Xu9CH4B1 I have shared the above data sample that I am trying to insert in Elasticsearch with the Mapping: elastic_search.indices.put_mapping( index=...
0
votes
0answers
38 views

node.js var for json parse?

I am trying to parse a json address which works fine when I enter the address statically. what I am trying to do is use a text box and a button to enter an ip address into a dynamic table which I ...
0
votes
0answers
16 views

Separating strings in a file, and store them in a vector of structs [duplicate]

Sorry for the poor wording of the question but can't think of any other way to put it (English is not my first language) So I'm going through the book Accelerated C++ and is trying to do exercise 5.2....
2
votes
1answer
39 views

How do I turn this .txt into a dataframe?

I am trying to do a Whatsapp analysis in Python and I want to convert this into a dataframe with columns for date, hour, person, and message. '[8/23/17, 1:45:10 AM] Guillermina: Guten Morgen', '[8/...
-2
votes
0answers
27 views

Parsing library of Python [on hold]

I want to write a parser of several sites on a python. But getting the object of the page, I see that it contains only html markup, the content that I need probably generates javascript. Prompt what ...
0
votes
1answer
20 views

Global variable undefined in javascript function that follows

I had some code that essentially was like this: TestFunction(); const pi = 3.14; function TestFunction() { alert("pi="+pi); } The code failed because 'pi' was undefined. I scratched my head for ...
1
vote
0answers
29 views

How do I aggregate JSON data using Jolt by two keys?

If I have an input of a list of JSON objects. How do I go about nesting the data in Java by the date, and then the category in and also sorting it by date in descending order? Input: { "data":[{...
0
votes
1answer
31 views

parsing html with css selector jsoup

I'm trying to get the value shown in the image below from www.dolarhoy.com I use jsoup to do thinks like this, but the following code is not working. private static String obtenerCotizacion() ...