Questions tagged [parsing]

Parsing is the process of analysing a string of symbols, either in natural language or in computer languages, conforming to the rules of a formal grammar.

Filter by
Sorted by
Tagged with
2
votes
1answer
65 views

Function that reads big files in C

I made a function that writes all the data from a hashtable to a .txt file and another to read the said data. The data comes from a this type of struct and it should be read into it when called <...
3
votes
1answer
230 views

CSV Reader from scratch

I am new to Java and not quite familiar with its design patterns. I have tried to implement a CSV-File reader from scratch. The CSVFile constructor accepts the path to the file and a class which ...
7
votes
2answers
541 views

Parsing small data into tuples

I'd like to make parsing small samples of data more efficient (from the developer point of view). This means, instead of writing the parsing logic each time from scratch when I encounter something as ...
2
votes
2answers
65 views

Parse and sort domain names and their prices

I set out to write a small Python script to tell me cheapest domains. I manually scraped for data from iwantmyname.com into a plain text file as follows: ...
4
votes
1answer
241 views

ASCII to uint16 using fallthrough

Introduction Watching this talk, I thought may be I could apply it on parsing smaller numbers, like std::uint16_t. I augmented it though, by using a fallthrough ...
7
votes
2answers
2k views

Python Prefix Notation Evaluater

I'm designing a new esoteric language, and the interpreter is in Python3. It is going to use Prefix Notation, so as part of the interpreter, I need a function that evaluates a string as prefix ...
1
vote
1answer
78 views

Parser for json-like format in PHP

At work they use a format similar to JSON but without quotes that looks like this: {foo:{qux:1,quux:0}, bar:{}} The reason they don't just use json is because ...
6
votes
1answer
2k views

Convert unsigned Integer to ASCII in x86 assembly

This is my best effort to code an x86 32 bits to get an unsigned int (4 bytes) and convert it into a string. My strategy was successively divide the number by ten and fulfill the remainder of the <...
3
votes
1answer
48 views

Finding the comic ID of the last XKCD comic published

I decided to sidetrack and create a XKCD viewer. For certain functionality, I needed to be able to find the ID of the last comic published. This was my attempt. I'm using Enlive here to parse the page ...
3
votes
3answers
172 views

Iterate over filename [closed]

My program inspects filenames which are delimited via underscores. So an example may be: This_is_an_example_of_my_filename.tif A counter example may be: This_is_a_very_bad_document.tif The ...
1
vote
2answers
132 views

Parsing NuGet packages.config with Parallel.ForEach

Below is a file parser for old style nuget package configuration files. The Parallel.ForEach is probably overkill; in most cases its fast enough without. However, ...
3
votes
1answer
1k views

XML Parser written in Java

Accepts a String (or a char array) as an input and stores the data in a tree structure. For example, given the input: ...
7
votes
3answers
5k views

Splitting std::string based on delimiter using only find and substr

I have been playing around with these two functions for a bit, dunno if this is practical though. I have only been learning C++ for a couple of days, coming from a Java background. There we had a ...
5
votes
2answers
1k views

Simple parser with regular expression

If I draw something in Illustrator and extract it with AI2Canvas I want it to be customizable so I wrote this simple program. It adds two variables: one to resize and one to shift the path coordinate. ...
4
votes
0answers
47 views

Parsing λ-terms using a very simple grammar

This is my first Rust program. It parses a string into a λ-term using a very simple grammar. Please evaluate style and use of ownerships / borrowing. ...
5
votes
1answer
302 views

Collecting YouTube links from a page

I wrote code for my needs (i.e. collecting YouTube links from a page) and it is simple, but now I just want to know what can I do just to make it a better and properly written one. For example, I ...
7
votes
5answers
4k views

String to double without std::stod

I encountered a pesky error in Code::Blocks: the conversions functions (stod, stof, stoi, ......
8
votes
2answers
902 views

Parsing oscilloscope binary data file with C++

Preliminaries I have OWON oscilloscope that is able to record waveform in file in three formats: Text format .txt: the first lines are some general information ...
2
votes
0answers
38 views

XML Input Parser To Load Test Data into Dev Database

I wrote an XML input transformer to ingest data from test directory and essentially store anything into a DB table. I attempted to make this as generic as possible. I'm new to Java and also realize ...
4
votes
1answer
365 views

Quadratic Equation Solver v2.0 in Javascript using Functional Programming

I have posted this in continuation to my earlier post Quadratic equation solver in JavaScript. Tried to improve on the shortcomings last time and also changed the logic. It is still not covering all ...
4
votes
3answers
1k views

Quadratic equation solver in JavaScript

The task is to implement a solveEquation function, which solves the Quadratic equation. Each equality has exact 2 integer solutions. Return those numbers as an ...
6
votes
1answer
85 views

Install Python script requirements

Sometimes I download a Python script (from a trusted source), and can't run it because of missing dependencies, which I have to install one by one (no ...
1
vote
0answers
325 views

A class to stop XML parser from converting UTF-8 entity hex characters

I'm trying to stop the xml parser from converting the UTF-8 enitity hex codes to its character alternative and also not adding the extra space in self-closing nodes after parsing. I've created a ...
6
votes
1answer
79 views

A simple BSON indenter / compacter

BSON is an extended JSON format. For example these documents are valid BSON documents, but invalid JSON documents: prettified documents: ...
1
vote
0answers
64 views

Flexible Image Transport System (FITS) file parser

I have a simple class which currently has some code in the constructor, which makes it difficult to inject and also test. ...
8
votes
1answer
122 views

Parse ping log to find total downtime

Trying to write a utility script to get downtime measurements from ping logs which generally look like this: ...
4
votes
1answer
232 views

Simple terminal-based Lua task-tracking/calendar

I am learning Lua and wrote this little calendar/time-tracking script. It allows me to create tasks to do with a deadline, print them, and mark them as being done. A task is a table with the following ...
4
votes
1answer
43 views

Parsing positive integers from CSV file Part-2

Part-1 here This is a small CSV parser for positive integers mostly intended for personal projects. I (hopefully) improved the code from Part-1 by condensing some parts and improving others while ...
6
votes
1answer
217 views

String to token vector for expression parsing

My objective is to create a linear algebra calculator that would be able calculate expressions containing vectors, matrices, (eventually complex numbers/imaginary; quaternions), and real numbers. I've ...
0
votes
1answer
180 views

Fast .slk (SYLK) file parser

For my project I need a (partial) .slk (SYLK) parser which need to load 10+ fairly large tables (30.000-50.000 lines) quickly. The subset is very limited to just the following format: ID;PWXL;N;E ...
3
votes
1answer
197 views

Parsing positive integers from CSV file

I Needed to parse some positive integers with the following constraints: If possible use C++ only (no C API) Needs to be able to process parsed data after each newline Should be reasonably fast ...
3
votes
2answers
194 views

Parse custom configuration file in C

I have to parse a custom configuration file with this structure: ...
4
votes
0answers
36 views

Parsing root-level elements out of HTML fragment file

I have the following code written in NodeJS, using the parse5 library. It's purpose is to parse out the root-level elements in a file containing HTML fragments (Vue ...
7
votes
0answers
319 views

C++ Parsing with chain of responsibility

The task was to create the parser for the string input, that would return the std::vector< int > of parsed numeric results and the type of given input (e.g. numbers, division by zero error, out of ...
12
votes
2answers
5k views

Parsing an email string

My program needs to parse an e-mail string. There are two possibilities to enter an e-mail-address. Either with the alias or without one, plain the e-mail-address. 1st possibity: ...
-1
votes
1answer
36 views

Filling ranges based on some specified strings [closed]

The method takes two parameters. If I call it with two parameters first : ["0-1000:2","1000-2000:3"] second: initial then ...
3
votes
2answers
12k views

HTTP request parser in C

I'm implementing a simple HTTP server in C, and this is the first part of it. Basically, it takes a string containing a "raw" HTTP request, and parse it into a ...
2
votes
0answers
79 views

Parse Mach-O binding info

I wrote this C program to open a Mach-O executable/framework and parse the external symbols along with their respective framework/library. A few things I would like to get better at: Memory ...
6
votes
3answers
844 views

Simple parenthesis removal - JavaScript

I solved the following problem: You will be given a mathematical string and your task will be to remove all braces as follows: ...
5
votes
2answers
3k views

Parsing a JSON file upload

I'm trying to parse a JSON file upload. I know the format JSON will arrive as this: ...
7
votes
1answer
258 views

Raspberry Pi Heating Controller

In "most" (my experience) older UK houses, Central Heating and Hot Water both come a gas boiler. They are controlled by a programmer, to come on at different times, which is effectively just three ...
3
votes
1answer
830 views

Parse data file and verify checksum

Here's my assignment: Write a program that takes a filename as its only command line argument and prints the results to std::out formatted as follows: ...
7
votes
2answers
5k views

Parse one table out of CSV with multiple titled tables with the Python CSV module

I'm looking to parse CSV files containing multiple tables using Python 3's csv module. These complex CSVs are not unlike the toy example below. My goal is to make ...
10
votes
4answers
11k views

Python calculator taking string input

It accepts string input like '1+1' instead of num1 = 1, num2 = 2, operation = '+' or something like that. ...
5
votes
1answer
191 views

Program to process fastq files

My program evaluates fastq files. The fastq file is just a huge text file (about 1,5gb in my case), which looks like this: ...
4
votes
1answer
1k views

Multi-query PHP Parser for SQL files

I have an external project, which needs to run an SQL file containing multiple SQL queries (a bit like mysqldump, if you like, but is user-created, with any kind of SQL statement/definition). PHP ...
6
votes
1answer
67 views

Python - basis of a parser library, followup

This is a followup to this question: link. As advised there, I've rewritten the State class, which also simplified some of the other code. I'm writing a parser library. I would like to know if the ...
3
votes
3answers
2k views

Creating and parsing query strings

In a moment of boredom, I decided to write two methods, one of which would create a query string, while the other would parse it, the constraint I imposed on myself being that each method could not ...
1
vote
1answer
47 views

Using an alternative for a switch/state-based custom parser

I'm currently developing a small tool that applies a number of regex-based match/replacement-pairs to the contents of a file (or, more generally speaking, a string). Note that regex-knowledge is not ...
3
votes
2answers
451 views

C++ string parser for wpa_supplicant

I have created a naive string parser for unsolicited wpa_supplicant messages. I could potentially extend this in the future. I am not sure if this is the best way to parse these kinds of messages. ...

1
3 4
5
6 7
24