57,573 questions
7
votes
2
answers
132
views
Ansible way to convert stdout lines to a dictionnary keeping multilines under the same key
Given the following text:
Param1 : Value1
Param2 : Value2
Param3 : Value3a
: Value3b
: Value3c
Param4 : Value4
I would like to obtain the following Ansible result dict of strings or ...
Advice
1
vote
10
replies
146
views
R sscanf equivalent
I have command line arguments or configuration parameter stored as strings. I want to use them as numbers, dates, boolean etc. A conversion functionality, using C is usually provided by the sscanf(...)...
Advice
0
votes
6
replies
74
views
Parsing pipes with boolean logic operators in bash
I'm investigating how Bash parsing works. Let's assume that all lower-case letters here represent scripts that always return a successful exit status - 0. The contents of all scripts are identical. ...
2
votes
5
answers
317
views
How to fix and parse dates based on unpatterened input formats
I am dealing with a dataset with four different inputs for dates in one date column (ymd, ydm, dmy, mdy). the dates in the column are input somewhat arbitrarily so lubridate::parse_date_time in any ...
Advice
1
vote
3
replies
79
views
How to properly parse MKV metadata
Recently I've started to work on a large personal project and one part of it is a metadata parser for video files.
I've already successfully parsed all of the formats I need (probably - proper testing ...
1
vote
1
answer
91
views
How to parse an escaped JSON string into a JSON object and use it as an object in a specified field in Fluent Bit?
The logs received by fluent-bit(forward input)
{
"date": 1765435213,
"log": "{\"time\": \"2025-12-11T06:40:13+00:00\",\"tcpConnectionId\": \&...
0
votes
1
answer
62
views
Rust Chumsky parser: () is not an iterator when folding repeated (BinOp, Expr)
I've been working on the 'multiplication / division and general expressions' portion of my parser in Rust complains that () is not an iterator when I try to fold over the repeated operator-expr pairs.
...
2
votes
1
answer
74
views
How to make the entire Parsec parsing process fail upon certain conditions?
I'm creating a toy language in Haskell, and using Text.Parsec to parse everything, So far it's worked great, but there's a certain feature that I don't know how to implement:
What I want to implement: ...
2
votes
1
answer
129
views
How save specific strings and then put next to lines?
I'm parsing a file using powershell 5.1 and I almost get my goal but I need help in this part. The input file is like this:
CODE=MMH4
description=beg somedata - dduik
CODE=PPH2
description=beg Area1 -...
4
votes
1
answer
109
views
How to evaluate arithmetic expression in pseudo‑SQL style (Lua 5.1)
In love2D I have a string that represents a mathematical expression, for example:
local expr1 = "[p35] div [p36]"
local expr2 = "((([p35]*100) div [p36]) mod 100)"
local params = {...
Advice
0
votes
7
replies
120
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, ...
1
vote
1
answer
78
views
java-cup sends "Syntax error @ Symbol: PARSER" and NullPointerException when compiling a .cup
I’m working on a DSL parser using Java CUP, and I’m getting this error when trying to compile my .cup grammar:
Error: Syntax error @ Symbol: PARSER (unknown:19/-5(-1) - unknown:19/1(-1))
Error : ...
0
votes
0
answers
46
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
114
views
More parsing-friendly Python debugger locals() output [closed]
I need the locals() text output to be easier to parse then what the default output is. I am using a IDE that I wrote in C that starts a tty() to run pdb and it captures the output from locals() and ...
0
votes
1
answer
97
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::...