57,580 questions
Advice
0
votes
7
replies
104
views
High volume URL parsing in Python
I use the polars, urllib and tldextract packages in python to parse 2 columns of URL strings in zstd-compressed parquet files (averaging 8GB, 40 million rows). The parsed output include the scheme, ...
0
votes
0
answers
36
views
Apply default or constant values to json
I want to modify input json before it will be processed by telegraf json plugin via json_query.
Is it possible to add some default value
or constant value to json via json_query?
For example, I have ...
0
votes
1
answer
57
views
How do I rewrite paths in an AST's import tree?
I'm writing a program that will update a Rust project's imports to be from their new locations after a breaking change in a library. In this instance, I'd like to flatten all imports from vexide::...
3
votes
1
answer
206
views
How to extract table from PDF with boxes into pandas dataframe
I have code that detects a table in a PDF that appears after a specific section, and parses the information in the table and copies it into a pandas dataframe.
Now, I want to indicate whether a box is ...
2
votes
0
answers
112
views
How do I properly use Libwebsockets' JSON parser (LEJP)?
Trying to figure out how the built-in JSON parser in libwebsockets works. From my understanding of the documentation, you're supposed to call lejp_parse(), giving it a JSON-formatted string and a ...
1
vote
1
answer
113
views
can the parser fetch duplicate key
I know that the Yaml spec requires key uniqueness in mappings, but is it possible the make the parser parse and return duplicate keys in order to do some special processing on the duplicate keys in ...
2
votes
2
answers
69
views
Get spaces count between nearest non-space character and given index
I have a string:
ONT ONT ONT Auto-neg Speed Duplex Port Flow Native Priority
And i need to get Auto-neg from it (for example).
I have start index of this word, for example 24.
I ...
0
votes
0
answers
43
views
How to build a gcc_tree_node from custom language Nodes
Nodes:
building a gcc_tree_node for a custom prograimming language
compile and base on C++26
the modules are avilable
the language using tab-block system
every keyword start with '/'
I want to ...
1
vote
1
answer
51
views
How to parse optional separator that can be part of formatted text?
I'm currently trying to parse a custom configuration format using ANTLR4. Here is what the input may look like (in reality it's a lot more technical, but I had to change it for SO bc I want to keep my ...
-3
votes
1
answer
101
views
Does anyone have a nice concise way of parsing bash function arguments and options? [closed]
Here's my current preferred method that I normally put at the top of functions:
#!/usr/bin/env bash
unset opts args
for arg; do [[ ${arg:0:1} == "-" ]] && opts+=("$arg") || ...
25
votes
13
answers
3k
views
How can I parse a string to a float in C in a way that isn't affected by the current locale?
I'm writing a program where I need to parse some configuration files in addition to user input from a graphical user interface. In particular, I'm having issues with parsing strings taken from the ...
5
votes
1
answer
136
views
An ambiguity in rust
Since we have no parentheses () in rust if and while conditions, there may be some ambiguous situations, e.g.
while 0 > n {} {}
is either parsed to be while (0 > n) {} and {} (2 statements),
or ...
1
vote
1
answer
58
views
Is it possible to make Bison utilize external token definitions?
I am working on building a compiler using Flex/Bison, and tried to utilize a tokens.h file to define the tokens used by the parser and lexer.
#ifndef TOKENS_H
#define TOKENS_H
enum TokenType {
...
0
votes
0
answers
36
views
GLPK sensitivty result parsing with PULP
I am trying to figure out how to read the GLPK sensitivity results back into Python
An example of how i am generating it:
import pulp
from pulp import LpStatus, value
from glpk_sensitivity_parser ...
0
votes
1
answer
121
views
Parsing data from a *.DAT file into CSV, with Laravel
I'm trying to parse some data from a .DAT file, which consists of some
data about transactions. Below is a sample of the said data:
CABCDE123456000000000000000ABCD12345678XY PAYMENTS ABCD ELECTRONIC ...
2
votes
1
answer
96
views
Capturing function parameters and optional type hints using regex
I'm trying to capture the optional type hints that come after parameter names for my own toy language so I can make them a different color, I'm using a tmLanguage.json file to create the synatx ...
5
votes
2
answers
168
views
Differentiating pointer declaration and multiplicative expression
According to the C language grammar defined in the standard, how will the statement a * b; be parsed?
Is it considered as a declaration of a pointer b to an object of type a? Or is it considered as an ...
1
vote
1
answer
151
views
How to efficiently parse data packets into structs
I am currently building functions that take packets of CAN data and parse them into structs depending on their ID as seen below.
Is there a 'cleaner' way of parsing data into structs instead of ...
0
votes
1
answer
58
views
Is there a programatic way to determine which ANTLR lexer a given ANTLR parser uses?
Let's assume I have a given ANTLR parser assembly with many Parser and Lexer classes contained within. Is there a programmatic way to determine which of the lexer classes a given parser class ...
1
vote
2
answers
84
views
How can I pass a parameter to a parser in Boost.Parser?
Please note that I am asking about Boost.Parser, not the older Boost.Spirit.
I have a reference to a symbols object that I want to use in a parsing rule. I think I want to use a parameter for that, ...
1
vote
0
answers
147
views
VBA MSXML2.ServerXMLHTTP request not working with Url including space character
I'm sorry if my request won't be very clear, but I'm not very familiar with the topic.
I'm trying to extract a Json database using VBA and, of course, Microsoft Excel.
My code is (simplified):
...
0
votes
1
answer
76
views
Google Sitemap namespace declaration issue
I have a sitemap index that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<...
0
votes
1
answer
231
views
Workaround for missing std::chrono::from_stream
C++20 introduces std::chrono::from_stream() to parse date/time from a string and store it in a std::chrono::time_point. For example:
std::stringstream ss("2018-12-09T00:00:00+0130");
std::...
0
votes
1
answer
42
views
Zeep SOAP Client: Fields Missing in Response of SOAP API
Short summary:
I'm using Zeep pip package to parse the National Rail SOAP API, and some fields (like the operator name/code) are showing up as None in the parsed response. The raw XML response clearly ...
2
votes
2
answers
54
views
Why qi parser stops before text end?
I'm writing a qi parser in order to parse expressions like the one below:
(!$23 && $45) || !$67
and possibly more generic like
!($1 && $2 && $3) || (!$4 && $5) &&...