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.

learn more… | top users | synonyms (1)

3
votes
2answers
29 views

Advanced CSV-to-SQLite converter

I just wrote an advanced CSV parser that translates CSV to SQL(SQLite Compatible) statements, which are then inserted into the database. It translates variable names in the CSV to values defined in ...
6
votes
1answer
58 views

Cleaning up HTML created by users

I have a system that accepts free text from users. This can either be plain text or a heavily limited subset of HTML. I've written the below with Html Agility Pack and Microsoft's AntiXss library. I ...
5
votes
1answer
58 views

JavaScript program to count lines of Java code

I've implemented a small program in JavaScript to count the number of lines of a string of java source code. This was done for one of the Code Kata exercise: ...
8
votes
2answers
164 views

Parsing a list of single numbers and number ranges

I have input of a string containing a single number (like: \$3\$) or a range (like: \$1-5\$). Sample input, all together, looks like: "1-5,3,15-16", and sample ...
6
votes
1answer
43 views

Manually parsing HTTP response header

Due to some constraints I had to manually parse an HTTP response coming out of a stream. I could not use buffered reader or scanner because the perform buffering and end up buffering bytes beyond the ...
5
votes
2answers
207 views

E-mail MIME message parser

As part of a larger Java application I'm working on, I have to retrieve emails and parse the data for the emails' content (subject, date, text, attachments, sender). In the method below, I pass a ...
5
votes
1answer
64 views

Parse OpenFoam files in Python

I'm writing a Python parser for OpenFoam mesh files. When the mesh is big, I face performance issues. Here is the format of the file describing the points: ...
-1
votes
2answers
52 views

Extracting a date and time from a log file

I am trying to make my code as legible as possible, and today I wrote the following snippet and I'm unsure as to whether it can be improved in an obvious way. There's always room for improvement, of ...
1
vote
1answer
21 views

Quickly passing and parsing variable length float arrays

I have this code for parsing for parsing a list of floats of variable length. ...
1
vote
0answers
50 views

Game server in Java querying MongoDB for JSON

I was hoping someone would have a look at how I retrieve the questions from the db, parse the JSON and process the results - possibly advise how I could improve efficiency by streamlining my code. I ...
4
votes
1answer
87 views

Obtaining different weather forecasts from the Environment Canada website

Here is the code I use to get the different weather forecasts from the Environment Canada website: ...
5
votes
3answers
625 views

Function that adds two integer strings

I wrote this method that adds two integers in the form of strings together. This way I can add large integers without overflowing. How efficient is the code that I wrote? I am by no means a great ...
1
vote
2answers
109 views

Parsing double from string

I'm trying to parse Double from String in Java. The string input is not necessarily a number, any non number input should be ...
5
votes
1answer
72 views

Parsing and plotting complex numbers

I am trying to write a Haskell application that parses a bunch of complex numbers from a Mathematica output and then produces a PPM image. The end product looks like this: The code to create this ...
2
votes
1answer
65 views

Parsing a component of a regex followed by an optional quantifier character

I have a piece of parsec code that parses a unit optionally followed by ?, + or ...
5
votes
1answer
63 views

High performance parsing for large, well-formatted text files

I am looking to optimize the performance of a big data parsing problem I have using Python. The example data I show are segments of whole genome DNA sequence alignments for six primate species. Each ...
10
votes
4answers
824 views

Method to count all comments in single external C# file

I recently had an interview question: Write a method that counts all comments in a single external file. It was a timed question and I wanted to know if this is the best way to accomplish the ...
2
votes
1answer
72 views

File parser to extract data from text file

I am trying to extract the data from input file and store it for plotting. I have tested this code for a few files of same format. I am not sure if the code works correctly with the little change in ...
2
votes
3answers
156 views

Reading a configuration file

I have written the following C code to parse a configuration file for settings to my program. I denote comments with a # and blank lines are allowed. e.g.: ...
10
votes
2answers
99 views

Processing command line parameters

This code works, but I'm curious what feedback you have about style and doing things in a more "pythonic" way. ...
18
votes
4answers
209 views

Convert Bitmap Font to Texture Atlas

I wanted to render the textures that comprise a bitmap font glyph onto the screen directly as an Image in libGDX. When you make a bitmap font using a program (such ...
1
vote
0answers
40 views

Parsing span library

This is a Python library for efficiently tracking span information while parsing source code, and generating errors on those spans. I intend to use it in my rewrite of mypy's Python parser to add ...
0
votes
2answers
44 views

Function that check's file type based on certain keywords

I have a function that breaks up a source file and checks each token against a keyword list to determine whether its a particular file type. How can I improve this function? ...
4
votes
1answer
60 views

XML parsing in Java using SAX parser

I have started learning XML parsing in Java (currently reading Java & XML by Brett McLaughlin). Here is my first program to parse XML using SAX parser. Please review the code and let me know if ...
10
votes
2answers
99 views

File parser convert to node data and neighbouring relational data

I have been working on a file parser that takes a very specific file format and parses it into a list that is arranged into node data and the neighbors that it relates to. I am new to Python (this is ...
7
votes
1answer
50 views

Python XML parsing, extraction and renaming files

I've written some code to: Parse an XML file. Extract some strings. Make copies of the original XML whose names are suffixed with the extracted strings. Please review this. ...
5
votes
1answer
89 views

Rust language tag implementation

language-tags is my first crate, it is hosted on GitHub and I uploaded it to Crates.io. It parses language tags like en-US into useful parts, like language and ...
6
votes
1answer
68 views

Templated Tokenizer Functions

I wanted to be able to tokenize a few different containers so I created a generic way to do it. I originally wrote this in Visual Studio 2012, but I had to modify it to get it to compile on Ideone. ...
4
votes
1answer
42 views

Find allele frequencies at each site for each iteration for each population from FASTA file

The script takes a FASTA format file in input and outputs the frequencies of each amino acid (A, C, ...
2
votes
2answers
71 views

Parsing a text file of node data into Nodes and Edges

I'm a fairly new developer (well, engineer really, but currently working on a software project). In the Android project I'm working on, I read a node representation of a map into my app and interpret ...
8
votes
3answers
73 views

Calculating bytes of code

I am new to Perl and I wrote this Perl script to calculate bytes of code and lines of code in a directory. I want to know if there are any improvements that can be made to it. ...
4
votes
3answers
366 views

Parsing huge data coming from a URL

I need to parse the data coming from the URL which looks like this: ...
8
votes
2answers
120 views

Parsing a simple tuple “(float,float,float)” in c++11 iostreams

I spotted this tutorial example at compactcpp: #5 – Parsing strings into “tokens” ...
5
votes
2answers
151 views

Script that parses the Chase.com page for my recent payments

I wrote this code earlier to parse Chase.com's online transactions page. It's written in WinForms. stepBtn is a button that starts this. ...
4
votes
1answer
56 views

Parsing a string to an object

I have this string containing this block of code: ...
2
votes
2answers
56 views

Structure of parser in Clojure

I'm working on my first Clojure project, which is a parser. Since it's my first project I'm unsure of many aspects, from my general approach to solving this problem to the small implementation ...
2
votes
1answer
71 views

Decode an alarm keypad message

In my efforts to learn the Swift language, I am trying to mix in a pet project along with my learning of the basic language syntax. In essence, i'm trying to write an iOS keypad application to work ...
5
votes
1answer
59 views

Dynamic length binary data parsing

I am currently writing code for a UART communication in my firmware. I am getting an interrupt every byte received (meaning I don't get a chunk of data, 1 byte at a time but, in the sample below I ...
2
votes
2answers
46 views

Email log parser

This code parses mail server log files and outputs statistics into an external file. Is there a way to make it more pythonic? Is it a good idea to use regex anywhere? Which libraries can reduce the ...
3
votes
3answers
474 views

Parsing multiple line records using Java 8 Streams

There was a suggestion in this StackOverflow question to move this question here. I added some more information and restructured the question a bit. I'm trying to parse the following file which ...
1
vote
1answer
58 views

Finite state machine for CSV data

I want to read a file containing comma-separated values, so have written a finite state machine: ...
4
votes
1answer
71 views

Create Java object from from page content or plain text

My job is to make a specified java objects from web page that contains following text: Companies: ...
0
votes
2answers
79 views

Unique combinations of sets with N min selections of overall set

I'm in the process of attempting to write a parser compiler. In this, sets play a major role. I'm in the 'lexical ambiguity' isolation phase, and to that, I need to yield a set of every possible ...
4
votes
0answers
127 views

RSS parser for Node.JS

I would like someone review this code and tell if it can be done better, or if the code is elegant and simple enough for the task at hand. I used code climate and I got 4/4 and my test coverage is ...
2
votes
1answer
62 views

Parse a string as a list of words and parse characters

I'm trying to create a list from a string with items alternating between words and parse characters like ['Hello', ' ', 'World'] Is there a built in function, ...
1
vote
1answer
113 views

Parsing a file for an Android device

I am trying to parse InputEvents of an Android device. Background: For an android device we have a utility getevent ...
1
vote
1answer
92 views

Parsing video files from a given directory

I have written a little class that is basicly looking for video files in given directory and then parsing some info about those files. Finally it saves everything in a list. To properly run this you ...
2
votes
1answer
75 views

Parsing oscilloscope data, follow up

Follow-up up on Parsing oscilloscope binary data. I wrote a simple parser for Tektronix's internal file format .isf. I revised my code to the following: ...
6
votes
3answers
129 views

Parsing oscilloscope binary data

I wrote a simply parser for Tektronix's internal binary file format .isf. The code is supposed to read in the file and return the header data as well as the actual ...
4
votes
1answer
148 views

Boolean expressions from infix to postfix notation using Dijkstra's Shunting Yard algorithm

I began working on a Java library that receives a boolean expression such as not A and (B or not C), compiles it to a circuit of logical gates \$\mathcal{C}\$, ...