Questions tagged [parsing]

Decomposition entails the disassembling of an object into its fundamental components while comprehending the interconnections among them. This label should not be utilized for inquiries concerning the locally hosted Parse Platform (instead, employ the [parse-platform] label) or troubleshooting parse errors in a specific coding language (employ the corresponding language tag).

Vue cookies experiencing issues with updating cookie values correctly

My goal is to store user preferences (maximum 2-3 users) in a cookie for easy access. Upon login, I first check if the 'users' cookie exists. If not, I create it. If it does exist, I check if the current user is included in the cookie. If not, I ...

How can you decode JSON using JavaScript?

Need help with parsing a JSON string using JavaScript. The response looks like this: var data = '{"success":true,"number":2}'; Is there a way to extract the values success and number from this? ...

Exploring and sifting through JSON data in PHP

Can someone assist me with parsing and navigating through JSON results using PHP? In the example below, I need to specifically target technology categories. What I want to achieve is to identify if the category 'analytics' exists in the result, set a true ...

Troubleshooting Problems with JSON Parsing in Node.js

After retrieving a JSON file and utilizing NodeJS to parse it, the structure of the JSON file appears as follows: { "id": 5, "x": 9.996, "y": 0.135, "v": { "x1": 0.653, "y1": -0.064 }, "z": 1.4730991609821347 }, { ...

Tips for dynamically changing the field name in a JSON object using Spark

Having a JSON log file with a JSON delimiter (/n), I am looking to convert it into Spark struct type. However, the first field name in every JSON varies within my text file. Is there a way to achieve this? val elementSchema = new StructType() .add("n ...

Received an email with another "toaddress". Where can it be located?

I recently received an email that was sent to multiple addresses on the same server. The server is set up for 'catch all'. However, when I check the header (imap_headerinfo) or overview (imap_fetch_overview), I can only see one 'to address' listed. The 't ...

Potential for Commenting in JSON

As a novice, I am venturing into the world of using JSON with VBA. My goal is to import data from an external source into Excel and then apply some VBA magic. The JSON format might seem complex at first glance, so I'm curious if there's a way to include c ...

What is the best way to extract data from a JSON column stored as varchar?

Could you please provide insight on how to extract data from a varchar type in both Presto and Hive? [{u'pageId': u'102', u'title': u'ud648', u'isBrandHomePage': 1, u'active': True, u'pageTyp ...

Sending server variable to client side script

I am currently using EJS as the templating engine for my Express application, but I'm facing some challenges with passing a variable from the server to the client script. Despite trying methods like JSON.stringify and JSON.parse mentioned in similar ...

Deleting occurrences of a specific text from a JSON document and subsequently analyzing its contents

I am having an issue with a JSON file in which there are strings of characters attached to many of the field names. This is making it difficult for me to target those objects in JS. The structure looks like this: "bk:ParentField": { "bk:Field": "Va ...

A simple method to determine the length of a response list in Python when using the requests module

When I'm using the request library to parse data, it returns a list of JSON data. However, when I try to find the length of the response list, I encounter an error that states TypeError: object of type 'Response' has no len(). Here is the code snippet I am ...

Access the data within the nested JSON object

As I attempt to retrieve a value from a deeply nested Json object, I encounter a Parse error: The Json data I'm working with: { "MessageId": "f6774927-37cf-4608-b985-14a7d86a38f9", "Time": "2017-04-06T16:28:38.07 ...

Ways to utilize the image string obtained from the .getExtra method

I have successfully created a listview in my app and parsed JSON data into it, including images and text. Now I am facing an issue where I need to pass the image to another activity when the user clicks on it. I can easily pass text data using putExtra, bu ...

Managing a unique section within package.json

Having a custom section in my package.json file is something I'm currently working with. Here's an example structure: { "name": "foo", "version": "0.0.1", "dependencies": { ... }, "mySection": { ... } } Retrieving the data from this custom sectio ...

Reading a complex json file with multiple levels in R

While I have a strong grasp of R, I am relatively new to JSON file formats and the best practices for parsing them. My current challenge lies in constructing a data frame from a raw JSON file that contains repeated measure data with multiple observations p ...

Extracting information from a website link using Python

Can anyone help me create a HTTP link using information from a database, such as IP and port number? I have tried the following code but keep encountering an error while parsing. Any assistance will be greatly appreciated. @app.route('/link_test/<str ...

What is the best way to handle cURL post data in PHP?

Is there a way to extract information from cURL posts using PHP? I have a PHP client that utilizes this cURL request: data1 = array( "email" => $email, "firstname" => $firstname, "lastname" => $lastname, "code" => $code ); $da ...

transforming a string into a pandas dataframe using Python

I have a String variable with data that I would like to convert into a data frame using Python. I need someone to provide guidance on how to proceed. Data : data1 Name Space -------------------- ...

Having difficulty parsing, filtering, or extracting a json.dumps object within a loop

I am looking to extract the first element starting after [{ using the code provided below. [ { "Bkav": { "category": "harmless", "result": "clean", "method": "blacklis ...

Exploring bookmark.html parsing with Node.js

I recently explored a few Node.js modules and came across netscape-bookmarks for managing bookmarks. Now, I'm looking to read the bookmark.html file that I have either created or imported from my Chrome browser. I attempted to use the 'npm-bookmark-parse ...

Tips for resolving SyntaxError: Unexpected end of JSON input when attempting to retrieve JSON data in NodeJs

Recently, I embarked on my journey into Backend development. For the past few days, I've been tirelessly attempting to retrieve a response from an API and display it on my HTML page. However, I keep encountering a persistent error while trying to pars ...

Unfamiliar String Conversion to JSON in Java

Need assistance with parsing a JSON-formatted string obtained from a URL. The field and size of the data may vary, making it difficult to iterate over the structure of the JSON object. Here is an example of the string: {"_index":"my_index","_type":"my_t ...

Regular expression for substituting pairs of keys and values within JSON data

Having trouble removing a specific key and value pair from a JSON string in Java. I've tried using regex but can't seem to get it right. Can someone help me figure out what I'm missing? "appointment_request_id": "77bl5ii169daj ...

Attempting to utilize the Optimist API's help() function to display the usage() information

I am relatively new to using optimist and despite my attempts at researching and experimenting, I have been unable to find a streamlined method for incorporating a --help option. In the documentation, there is mention of a help() function. Based on this i ...

Attempting to implement a loop to remove specific characters

for num in range(0,len(input_user)): if input_user[num] == ('-'): if (input_user[num - 1].isalpha() and input_user[num + 1].isalpha()): goal += input_user[num] else: ...

Struggling with understanding how to parse JSON in VB.net

Looking for some assistance. I'm grappling with parsing the JSON output provided by the cloudstack API in vb.net and feeling a bit stuck. The JSON response from the cloudstack looks like this: { "listcapacityresponse": { "count": 6, ...

Troubles encountered while parsing nested JSON objects with a streaming parser

I'm currently using the code provided in this helpful resource for parsing my JSON: Although it successfully handles most of the JSON data I have, it encounters issues when a JSON object is directly nested as a child within another one. To illustrate the ...

Tips for Extracting Content from Unformatted Text Outside of HTML Tags

When parsing a text, each word is turned into a link. The issue arises when punctuation marks are not included within the <a> tags. I am unsure of how to handle this and include the punctuation marks as well. <table> <tbody> <tr& ...

I need to change a website into a string so that I can analyze it with javascript. How can I do this?

Currently, I am in the process of creating a website for my video game servers. The admin tool we use outputs the current server status in a .json format as a large text string to this specific URL: My goal is to retrieve the entire text string from the p ...

Is it worth developing a QT C++ class specifically designed for storing parsed information from JSON text?

Question Summary Is it advisable to develop a class for storing information parsed from JSON text with QT C++? Are there better alternatives? NOTE! I'm limited to posting only two links due to being new, but if more information is needed to answer the q ...

A Fresh Approach to Altering Dictionary Organization

In Python, I am working with an object type that contains multiple entries in the data-object. An example entry is shown below: > G1 \ jobname x [3. ...

The JSON parsing encountered an error with the response having "status":200 and "statusText":"OK"

I am encountering a parse error when trying to send a JSON object. {"readyState":4,"responseText":"","status":200,"statusText":"OK"} Here is the code snippet: var data = { fb_id: response.id, email: response.email, name: response.name, first_nam ...

obtain the text content from HTML response in Node.js

In my current situation, I am facing a challenge in extracting the values from the given HTML text and storing them in separate variables. I have experimented with Cheerio library, but unfortunately, it did not yield the desired results. The provided HTML ...

Extracting the text content of a specific tag while ignoring the text within other tags nested inside the initial one

I am trying to extract only the text inside the <a> tags from the first <td> element of each <tr>. I have provided examples of the necessary text as "yyy" and examples of unnecessary text as "zzz". <table> <tbody> <tr ...

Extract specific information from a text file by parsing it based on a given list

Looking for assistance with extracting a part of a txt.file, specifically: #some comments #some comments #some comments # Predicted genes for sequence number 1 on both strands # start gene g1 scaffold_0 AUGUSTUS gene 1268 6647 0.19 - . ...

Guide on incorporating curl in Java and extracting JSON feedback

Is it possible to use a curl command that provides a JSON response in Java and parse the JSON response using Java? Here is an example of Java code attempting to achieve this: public static void main(String[] args) throws Throwable { try { In ...

BufferedReader is unable to process lengthy lines of text

While working with a BufferedReader and HttpUrlConnection to read a file from this URL: https://www.reddit.com/r/tech/top.json?limit=100, I've encountered an issue. Even though my code is able to read some of the file, it only captures about 1/10th of its ...

Ways to verify if JSON.parse fails or yields a falsy outcome

Objective: const jsonData = JSON.parse(this.description) ? JSON.parse(this.description) : null When executing the above statement, my aim is to have the ability to parse a value successfully and return null if parsing fails. However, instead of achieving ...

Looking for assistance with creating a .NET regular expression specifically for parsing JSON data?

Currently, I am in the process of building a JSON parser for .NET that is effectively parsing JSON objects. However, I have hit a roadblock when it comes to parsing complex strings. For instance: The parser is able to successfully parse \"Hi there!&b ...

Python Elastic Reindex: issue with field [source] parsing encountered

I have been attempting to reindex an index using a Python function like this: resp = client.reindex( body={ "source": { "remote": {"host": "url_name:9200","username": &qu ...

Retrieve the inner object contained within a JSON file

I have encountered an issue while trying to parse a specific json format on android. The json structure is as follows: {"header": { "param": "param" }, "body": { "param": "1", "param2": "2", "param3": [ ...

Using Gson for multiple serialized names with the same data type

I am facing a challenge with my class: public void results{ @SerializedName("object1") @Expose private Object1 object1; @SerializedName("object2") @Expose private Object2 object2; @SerializedName("object3") @Expose private Object3 object3; @Serialized ...

Utilizing Json and Gson for Android Development

Could someone please explain the distinction between JSON and GSON to me? I keep coming across the term GSON while researching JSON, but I'm not sure how they differ. I'm confused about the specific differences between the two. Additionally, I've encount ...

Is there a way to properly dissect or iterate through this?

I have exhausted all possible methods to retrieve the data, but I am unable to solve this puzzle. The information is organized in a format like the following: [{"code":1000,"day":"Sunny","night":"Clear","icon":113,"languages": [{"lang_name":"Arabic","lan ...

What are the steps to decode a JSON response using jQuery?

Working on a fun little web app for my significant other and me to keep track of movies we want to watch together. I'm exploring using TheMovieDatabase.org's API (which only supports JSON) to simplify the process of adding movies to our list. The ...

Tips for retrieving javascript-generated HTML content

Currently, I'm attempting to retrieve article headlines from the NY Times website. Upon inspection, it appears that the HTML is being generated by Javascript since it's only visible when using the 'inspect element' feature in Firefox. Is there a way for ...

Parsing DXF files using only plain JavaScript

Currently, I am immersed in a CNC project and aiming to convert DXF files into objects using JS. Initially, I attempted using SVGs but the results were not as expected - instead of shapes, the drawings exported as lines (e.g., a square appearing as four se ...

Searching for tables data by employing the Curl command

Seeking assistance with parsing data from a website. The JSON request runs successfully in the command line but encounters issues when attempting to execute it on Android: The request: "curl '' -H 'Host: billetterie.ctm.ma' -H &apo ...

What is the process for extracting content from CSS comments or annotations in a stylesheet?

Here's an interesting concept: allowing users to define a set of CSS rules with annotations. For example: /* @name Page style */ body { font: 16px/1.5 Arial; /* @editable */ background-color: #fff; /* @editable */ } /* @name Section header */ ...

Struggling with parsing JSON data into a TextView resulting in app crashes

After completing the input, the app crashes without executing any further actions. I have modified the code to display only the UPC and Product information instead of the entire section. Any suggestions on how to fix this issue? If there is a similar que ...

Issue with the beautiful soup 4 library

I'm feeling puzzled as this code seems to work inconsistently. It utilizes the beautiful soup module and I'm curious why it functions in certain situations but fails at other times. from bs4 import BeautifulSoup import requests import lxml import ...

Determine the frequency of specific keys in JSON data and retrieve corresponding values

Within my JSONObject (not an array, which I am open to converting), I am attempting to achieve two objectives: Determine the count of genre entries labeled as "poetry" (count = 2). Retrieve the key value pairs for author name and genre: authorName ...

Combining XLSX columns in Node.js prior to transforming them into JSON

I have a table that looks like this: https://i.stack.imgur.com/pSpmD.png Currently, I am using xlsx sheet_to_json to parse the data from the table. The resulting output is as follows: [ {id: "123", title: "John", __Empty: "Key", __Empty_1: "GA"}, ...

use triple quotes for python variable declaration

I am looking to extract information from an HTML file that contains elements with the class name "link". My challenge is to read each line into a variable and then parse it, all while using triple quotation marks. How can I create a string variable that ad ...

Tips for extracting the data from a JSON response using Swift 3

This JSON data is the server's response to my request, but I'm struggling to extract and parse the values correctly. {"items": [{"item": { "id":824, "company_id":31, "config_id":45, "imagesmall":null, "im ...

Tips on verifying the presence of an element within the HTML with Selenium

My inquiry revolves around a specific process. I am tasked with locating an element on a webpage using its class, extracting and displaying its text, then splitting it into parts using the split() function. However, I encounter an error when the specified ...

Dealing with unescaped double quotes in values while using JSON_VALUE()

I'm currently facing an issue with a table in my database where the field JSONDetail stores JSON data. The problem arose when we encountered unescaped double quotes within one of the values in this field, likely due to migrating from a system that allowed ...

Breaking down this JSON (array)

Greetings! I have a section of JSON data that requires parsing, and I have condensed it for better visibility. [ { "trends": [ { "name": "#CyberMonday", "url": "https://twitter.com" }, { "name": "#Bl ...

Having trouble with the JSON Parse function in my code, but it seems to be functioning correctly

As a beginner programmer, I am currently working on developing an application using Json. In order to accomplish this, I have created a Json parser class and incorporated the following code into my main activity: JSONObject json = ...

Leverage boost library to extract data from a json array

Here's the JSON data that needs to be parsed: {"jsonrpc":"2.0","method":"subscription","params":{"channel":"book.BTC-PERPETUAL.raw","data":{"type":"change", ...

PHP: Parsing HTML Tables with Headers and Irregular Body Rows Using Simple HTML Dom Parser

In an HTML table, the data is structured as follows: Header 1 has Row 1, Header 2 has Row 2 and Row 3, while Header 3 has Row 4, Row 5, and Row 6. <table> <thead> <tr> <th>Header 1</th> </tr> </thead& ...

Locating the source of a JSON parsing error

Currently, I am in the process of developing a web application that enables users to upload data in JSON format. The method I am using to read local JSON files is as follows: function loadJSON(url, callback) { // set MIME type to avoid XML parsing in Fi ...

Performing recursive XML parsing with the power of JQuery

<script> $(document).ready(function(){ const xmlData = "<root> <method name='A'> <childcall name='B'></childcall> <childcall ...

Python: Flattening and Extracting specific JSON segments

I've got an input JSON that has the following structure: > {"payment": {"payment_id": "AA340", "payment_amt": "20", "chk_nr": "321749", "clm_list": {"dtl": [{"clm_id": "1A2345", "name": "John", adj:{"adj_id":"W123","adj_cd":"45"}}, {"clm_id": "9999", " ...

Navigating through the process of combining non-fixed key multilines of JSON into a single abstracted JSON structure

Given a large JSON file with 30 million entries like the following: {"id":3,"price":"231","type":"Y","location":"NY"} {"id":4,"price":"321","type" ...

Guide on extracting information from a JSON array consisting of objects and adding it to a Pandas Dataframe

Working with Jupyter Notebook and handling a Batch API call that returns a JSON array of objects can be tricky. The parsing process involves using for loops, which may seem weird at first. In my case, I needed to extract specific JSON object information an ...

"Process the contents of a file by reading it line by line in a

Currently, I am reviewing the documentation for the nodejs readline module in order to tackle a task that involves reading a very large file line by line. The solution using readline seems promising, although I require it to read lines synchronously - mean ...

Understanding Json data using Jquery

I am currently learning about Jquery, Ajax, and JSON but I am having difficulty with parsing Json data. Despite researching extensively on stackoverflow Parsing JSON objects for HTML table Access / process (nested) objects, arrays or JSON Parse JSON in ...

Swiftly retrieving and interpreting JSON data

I'm running into an issue where I need to fetch JSON data from a website and parse it before displaying it in an iOS view. Take a look at my code; func initiateConnection(){ let urlPath: String = "http://examplewebsite.com/somejson/" var ...

Is there a way to process the output of phantom.js in PHP efficiently?

I have successfully retrieved output from a phantom.js request via the command line and it meets my expectations. Now, I am interested in invoking phantom.js from a php script and then analyzing the output for specific content. My phantom.js script appear ...

Is there a solution available for tidying and organizing a CSS stylesheet efficiently?

In the project I am currently working on, the previous developers took an interesting approach by constructing all the selectors based on individual properties. For instance: .panel .selected a, a.selected-thumb, .date-picker input[type="submit"], .headi ...

real-time parsing of JSON responses using PHP

I am currently conducting research for my graduate program in finance on the topic of crypto currencies such as bitcoin. I am focusing on extracting individual data from JSON responses provided by the cryptsy API, which is a platform for trading crypto cur ...

Gson throwing an error with an unparsable date format?

I am encountering an issue while attempting to parse JSON data with a Java POJO class. Below is the JSON and POJO structure: JSON: { "startDate": "2018-09-18T12:00:00+0000", "endDate": "2018-09-18T14:00:00+0000", "startDateAsDate": 153 ...

What are alternative methods for reading JSON files in PHP that do not involve file_get_contents()?

Recently, I developed a basic PHP script that fetches data from a local JSON file and uses it to respond to various queries directed at the page. In my implementation, I adopted the usage of file_get_contents() for reading the file. However, as the number ...

What is the best way to deserialize certain fields from a Json object using Gson?

Here is the JSON string I have: [ { "channel": "/bvmt/initValues", "data": { "value": { "instrumentIds": "['TN0007250012','TN0007500010']", "instruments": "[{'mnemonic':'ADWYA','marche':'ADWYA','phaut':5.82,'open':5.82,'nb ...