1,436 questions
0
votes
0
answers
38
views
TextFSM parsing column-aligned CLI output where optional columns shift due to variable whitespace
I'm trying to parse output where the records are aligned via variable white space. Here is the output in question:
VLAN Table
VLAN VLAN Name Type Secure eth0 eth1 eth2 ...
Advice
0
votes
2
replies
77
views
How to handle variable-length header values when parsing HTTP requests in Java?
I'm building an HTTP server and parsing request headers. My current code fails when the Host header includes a port number because I'm splitting on :.
Current Code:
String[] header = line.split(":...
4
votes
3
answers
81
views
pyparsing for syllables is too greedy
I'm trying to parse syllables with pyparsing. I'm working with a language that has a CV(C) syllable template, so every syllable starts with a consonant. However, my parser is "eating" the ...
-1
votes
4
answers
117
views
sed works, but just for some files [closed]
I'm migrating a blog from Jekyll (source) to Hugo (source).
Both use Markdown, but their syntaxes are slightly different.
Let's say that in the old Jekyll blog I have this:
{% include image.html src=&...
2
votes
4
answers
260
views
Continue in C jumps the iteration of the outer loop?
I'm implementing the K&R Exercise 3-3 (expand()) that expands shorthand notations like a-z into full ranges.
In this version, I'm trying to handle overlapping ranges like a-b-c by using a last ...
0
votes
0
answers
111
views
Parsing .ini file using Linq
I am trying to parse an ini file and grab specific key-value pairs,given a section name and key name. I use the following code, using Linq, and it works if I don't include the key name in its search ...
5
votes
2
answers
239
views
How to parse a nested structure presented as a flat list?
To easily understand my problem, below is a simplified version of some example input.
['foo', 1, 'a', 'foo', 2, 'foo', 1, 'b', 'foo', -1, 'foo', -1, "bar", 1, "c", "bar", ...
-2
votes
1
answer
127
views
Create a function to use elimination logic to split a list of strings into substrings
I have a list of strings where each string represents the names of two tennis players that played in a match. The list of strings collectively is all known matches in a tournament. An example of a ...
0
votes
2
answers
159
views
How do I extract fields from the tabular text output of the Cloud Foundry CLI?
I have a Cloud Foundry CLI command, cf apps, that outputs:
name requested state processes routes
appname_1 started web:2/2 route1.com
appname_2 started web:1/1 ...
-1
votes
1
answer
88
views
How to parse an ini-like string into an array
I'm working on a song database application with an existing database. In the editor the songs are laid out like this in the contents column:
[chorus]
And all will surely agree,
There's nothing like ...
1
vote
1
answer
2k
views
Regular Expressions in Power Automate Desktop /Set Text Parsing
I'm working with a list extracted from OCR of receipt content in Power Automate Desktop and want to filter for specific numeric groups (prices). The issue is that numbers in 00-00 date format keep ...
4
votes
2
answers
131
views
How to extract a substring from an EDL line, between 2 sequences of characters
With Powershell, I want to extract from a video markers EDL file (Edit Decision List), the content related the Marker name.
Here an example of an EDL line
|C:ResolveColorBlue |M:The Importance of ...
1
vote
1
answer
140
views
Python (pyparsing): parsing legacy curly braces file format
I have to parse with Python (pyparse) a legacy file format that is not well defined.
It is of the curly brace family (im fact, having to parse arbitrary curly brace formats is a recurring issue ...
1
vote
4
answers
104
views
Extract text after Nth occurance
I have several strings like this:
1:723:NVDA:NSDQ::Z4189274321:Snapshot Report:10:COMPUTER & TECHNOLOGY:241:Semiconductor
I need to return everything after the second colon (:). So, from the ...
1
vote
3
answers
64
views
passing a list of quoted strings as a parameter to a SAS macro and using it in a data field
I am writing a macro to send e-mails, using a rest api available in our company.
(The macro will be deployed as a sasautos macro.) The attachments parameter should allow to pass a list of file paths, ...