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)

1
vote
1answer
32 views

Parsing US addresses without regular expression for performance

Looking for some constructive feedback on Parsing an Address without using Regular Expression in C# for performance purposes. My aim is to clean the data and to separate it into its respective ...
1
vote
0answers
14 views

Parsing .PLY file using F#

I'm fairly new to F# and have written a program to parse PLY files - this is however done in an imperative way with mutable values and as far as I know that should be avoided in functional languages. ...
4
votes
2answers
64 views

Parse HTML to modify it

I'm using the following code to parse html, This code is working but since I'm new to JavaScript and working in alone project I would appreciate if you can give me some tips and feedback how can I ...
1
vote
1answer
59 views

Parsing an address without regex [closed]

I am looking to improve on this code as it is not fully working properly yet. This address parse separates street number, street name, street type, apartment name and number from a string of a given ...
2
votes
1answer
87 views

Loading data from a text file into the database as fast as possible

I'm building a Django (1.8.12) application that parses a .bc3 file (Standard Interchange Format for Databases of Construction and Real State) and loads all the data into the database (PostgreSQL ...
3
votes
1answer
65 views

Parsing speech out of text

I'm working on an experiment to parse speech out of an emote in a text roleplaying game (MUD) so that if you can't hear it correctly, or if it's in a different language, you won't understand it. This ...
4
votes
2answers
81 views

Parsing a string as fast as possible that is using comma delimiters

I have made a simple static parser for a bigger program. This parser takes a string that has comma deliminators and I need to separate the strings in to a vector for handling in a different section of ...
2
votes
1answer
23 views

Read group of keywords from file, modify value, store new group to variable

I would like to use the following routine in my submission script for GAMESS calculations. I am not entirely sure if this is the optimum way to go. This function would need one of the messaging ...
3
votes
0answers
20 views

Extend API of complex source-code parsing CPAN module

I am working on a source line parser using PPI. After working a while, I realized that it would be nice if the PPI API had ...
2
votes
1answer
34 views

Simplified error handling when reading from stdin and parsing to a type

I've recently started learning Rust, and I've managed to whip up this function, which reads and parses a thing from stdin. I don't like it though, and I feel it ...
5
votes
1answer
48 views

`read` re-implemented for Int's

I have written a safe read function for haskell (for education!). I think this is fairly idiomatic haskell code, but I'd like to know for sure. If you see anything else that could be improved, please ...
2
votes
1answer
38 views

Getting the program's first argument as a number

I want to get the first argument as a number, if there is any. This does not feel quite right, but I don't know yet what the Rust way would be. I'm not searching for a args-framework or something, I ...
2
votes
1answer
29 views

Java class that parses Shoutcast stats XML

I have written a Java class that parses Shoutcast 2 stats XML. It uses JDOM to parse the XML. I have only basic knowledge of Java and I wrote this class in about 3 hours. It works, but I don't know if ...
7
votes
3answers
97 views

Prolog parser written in Haskell

I am writing a very simple Prolog intepreter in Haskell. It's a class assignment and I really want to do it right. I was able to (quite quickly) write a parser for the language. Today I borrowed a ...
1
vote
1answer
50 views

Converting an SVG polygon path from relative to absolute coordinates

This question was moved from StackOverflow as suggested by some users. I developed a function that aims to (should) provide a simple and effective method to transform a polygon ...
3
votes
0answers
26 views

Memory efficient Log Parser

I wrote this together for a test I'm doing that parses the Heroku access log. What I'm mainly interested is if this code follow common best practices and if there are any improvements I can make in ...
1
vote
2answers
144 views

Parsing two digits

This parses two digits and returns the rest of the string. Input: "20asg" Output: { number: 20, left: "asg" } Input: ...
4
votes
2answers
88 views

Reading file into structure

At the time I'm trying to read a quite big file into a C program for later user. The file size is in the range of 800 megabytes containing around 20 million lines of data of the following format: ...
3
votes
1answer
31 views

Putting a matrix from a text file into a list

I'm trying to read a text file with matrix and put it in a list, but I am using two loops here and I want my function to be faster. ...
4
votes
1answer
55 views

Parsing JSON using jsoncpp

I left questions in the comments strategically, since I think it's easier to answer questions this way. Basically what my small class does is abstracts away functionality that was originally in a ...
0
votes
1answer
114 views

Parsing JSON in one go using state machine solution

I need to parse a simple JSON string (flat JSON, no hierarchy) for keys and values, and there is a system constraint that I cannot use any built-in JSON library and can only read a string once due to ...
0
votes
1answer
43 views

Excel-to-JSON parser

I just wanted to build a simple converter from an XLS Excel file to JSON. I have predefined JSON format. All fields except of two - are just simple mapping from Excel to JSON. The two fields have a ...
4
votes
1answer
31 views

Using arrays to read in file, append it with parsed program output and overwrite original

Yesterday a friend of mine asked on U&L: How to optimize 'grep'-and-save? I will summarise shortly. The output of the torque pbs queueing system tool qstat ...
2
votes
1answer
41 views

Regular expression matching with string slice in Go

I have a slice of strings, and within each string contains multiple key=value formatted messages. I want to pull all the keys out of the strings so I can collect ...
5
votes
3answers
372 views

Parsing a complex number using regular expressions

Requirements were to create a constructor for a complex number, that receives a string. For example: \$3+5i\$. The regex extracts positive or negative numbers from the string with optional decimal. ...
1
vote
0answers
54 views

Email text parser

I am writing a parser to parse out the fields of an email message in the following format (note that I expect that the "To:" field could contain multiple lines, same with the "Subject:" field. ...
1
vote
2answers
32 views

Finding a delimiting character in a text file

I am writing a program that is capable of reading a matrix supplied from a text file. One intended feature of this program is that it should be capable of detecting various delimiters in the text ...
3
votes
2answers
38 views

Configuring fields to be extracted by a data processor

I solved this problem using closures with Perl and I wonder if/how I could/should have done it differently? Background: User creates config file describing properties of some source data file that ...
3
votes
0answers
59 views

Expression parser using Shunting-yard algorithm

I've been working on a expression parser which will be part of another project (some sort of DSL). This parser basically uses the Shunting-yard algorithm, except for the case of parenthesis: here it ...
6
votes
3answers
183 views

Base converting with strings from bases 1 to 36 to bases 1 to 36

I'm writing a fastest-code challenge over at PPCG relating to base conversion of bases 1 to 36, and as a part of the process for writing the competition, I decided to write my own program for it. This ...
3
votes
3answers
81 views

XML parser using PHP

It is just one of the files. I have also tried to write some tests using PHPUnit. Please give me some suggestions to improve my coding-writing skills. The below is the test file for the above file: ...
2
votes
2answers
46 views

splitting multiple joined words, port from perl to PHP

Though i have never worked on perl, not even once. I have ported the perl code into PHP and it seems like giving a correct result. But as I am going to use it on production server. I want this code ...
1
vote
0answers
17 views

Expression parser in Haskell using operator precedence table

This is my first non-trivial Haskell project, an expression parser implemented using the Pratt Parser's technique for managing precedence as a layer on top of Parsec. It simply builds an expression ...
0
votes
1answer
41 views

Parse a string to get a SectorId

In mobile phones technologies, a SectorId is a 128-bit value broadcast by a 1xEV-DO BTS system. That is a 16 bytes data. I made a structure to store them: ...
3
votes
1answer
55 views

Reducing memory footprint when manipulating big csv file

I have CSV file which has structure like this (separated by tabulators): ...
7
votes
1answer
70 views

RFC 4180-compliant CSV parser in Java

While looking at a recent question, I realized that there is no CSV parser in the standard Java library. I decided to write one that complies with RFC 4180. Highlights of the standard include: ...
19
votes
5answers
929 views

An OEIS Lookup tool in Python

I'm from PPCG so I was making an esolang and I decided to write it in Python. Eventually it went from an esolang to an OEIS (Online Encyclopedia of Integer Sequences) lookup tool. I'm very new to ...
5
votes
4answers
901 views

`atof` implementation

I have implemented the atof function. Here is my implementation ...
2
votes
1answer
57 views

Student data parsing application

My application takes a .csv (comma separated values) file and serializes the data into a binary file. Then it converts the binary file back to a .csv file (identical to the original file). For ...
6
votes
2answers
114 views

Matrix and Complex Numbers Parser

I have been working on a simple calculator project in Java since November 2014 as hobby. Now I want to add complex number support and Matrices. I also wants to add support for symbolic computation in ...
3
votes
1answer
42 views

Terminal ESC Sequence Decoder

The goal of this code is to read-in a stream of terminal ESC sequences, and break them down and fill a vector of parameterized sequences for processing later on. For example ...
7
votes
2answers
78 views

Calculate food company sales for the year

I am working on a Python project where a food processing company is trying to calculate its total sales for the year. Python has to read from a text file where its divided into for categories split by ...
3
votes
1answer
86 views

Parsing data from text with repeating blocks

I am parsing the responses from our Varnish load balancers in order to monitor the status of various nodes. One of the responses we get is text consisting of multiple blocks of data, one for each ...
2
votes
4answers
143 views

Consecutive whitespace reduction

I pursued an according algorithm with an absolute best performance, the following class embodies the solution. Any comment is welcome. ...
0
votes
0answers
70 views

Calculator in Node.JS

I'm new to parsing, and there's only one way to learn anything, and that's to do it yourself. So I did. I wrote what is essentially a calculator. But instead you will send it a string and it will be ...
4
votes
1answer
51 views

Multiple base numbers parser

This code is a Parser that parses numbers according to R5RS. #b1001 - binary #o2127 - octal #h02d - hexadecimal #d1231 - decimal 3923 - decimal It is ...
7
votes
1answer
65 views

Assembler listings parser components: Operands parser

I'm building the above mentioned parser. It reads a string of assembler instructions. I want to become a better coder, so I wanted to get a code review to start learning to do things property. As we ...
6
votes
1answer
89 views

Somewhat Advanced C++ Calculator

I am currently in the process of learning C++ from C++ Primer. I have found the exercises in this book to be somewhat dull in that they only test syntax and not reasoning. As such, I have recently ...
3
votes
1answer
43 views

Bash function to parse git status

I have a function here and wondered how well this can be refactored. I currently have this: ...