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
4answers
385 views

Speedily Read and Parse Data

As of now, I am using this code to open a file and read it into a list and parse that list into a string[]: ...
6
votes
1answer
831 views

Using Parsec for lexing&parsing

I'm creating list of Tokens from input [Char] stream using Parsec v3. The definition of Token...
7
votes
1answer
371 views

Song repetition manager with Stack

The exercise was to take a file such as this: ...
3
votes
3answers
227 views

Parsing Placeholders as SQL Arguments in PHP

I am trying to find a good way of parsing SQL arguments, the way I am accomplishing it now seems like it can use a lot of improvement. I am trying to convert arguments that are split apart by ', & ...
3
votes
1answer
4k views

Reading a large XML file and parsing necessary elements into MySQLdb

I have fair concept in a programming (learner) but not an expert to refactor code at the highest level. I am trying to read a huge (100MB-2GB) XML file and parse necessary element (attributes) from a ...
4
votes
4answers
3k views

File parsing code in C++

I'm processing about 3.5gb/15minutes, and I was wondering if I could get this down to a better time... Note that this is for a very specific CSV file, so I am not concerned about generality - only ...
7
votes
3answers
3k views

Google Weather API wrapper

I'm an amateur programmer (self-taught). Anyway, this class provides a few methods to access Google's unofficial weather API. I'm having trouble on how to go about handling parsing errors in ...
9
votes
2answers
7k views

Same code to parse int, float, decimal?

I have a method to parse strings. It can be used to parse a float using a specific culture ...
3
votes
1answer
16k views

XML schema parsing and XML creation from flat files

I am new to Python and had to create a schema parser to pull information on attributes and complex types, etc. and then convert data from flat files into the proper XML format. We are processing a lot ...
4
votes
1answer
5k views

Extracting text fields from <span> tags in an HTML message

What i'm doing I have a string with html information like this: ...
5
votes
1answer
7k views

Code to Parse dollars and cents?

I've written code to parse dollars and cents entered by the user. The value returned is the total number of cents. For example: ...
1
vote
1answer
220 views

Parsing XML file containing some events

I'm a beginner and have written my first Python module that parses a XML file containing some events and prints them out to stdout as JSON. I would appreciate some ...
8
votes
1answer
2k views

Parse Java source code

I have a bunch of simple interfaces like this one (pretty enough formed, but not guarantee) ...
6
votes
2answers
11k views

Parsing JSON with JavaScript

I need to write some JavaScript code that will take a JSON string, parse it, and return the names of the most-deeply nested properties. For example, for this input: ...
5
votes
3answers
399 views

Is this query-string parser bug-free?

I tried to implement a definitive, reliable URL query string parser that handles every corner case: it tries to be efficient by avoiding regex it takes full URLs or just query strings (as long as the ...
3
votes
1answer
564 views

Conditional parsing, non-standard approach

Conditional parsing (aka read some tokens and return true or false). As a solution to this SO question, I wrote following code: ...
3
votes
2answers
165 views

Verb tense parser

I have written this Perl code, and there is still more to add, however I was hoping that I could get some opinions on whether it could be written better. Specifically, there is a central ...
5
votes
2answers
734 views

Code review - parse a query to arrays

I have a query like this "abc=1, def=2, ghi=3" and I need to parse it into arrays like this ...
2
votes
1answer
174 views

Processing lexical analyses of sentences using the Perl split function

I have two kinds of lexical analyses of sentences that I need to process. One type of data comes in a "tagged" format, and the other comes in a "parsed" format. Tagged The input (...
4
votes
1answer
331 views

Using Regex to parse a chat transcript

I need to classify each line as "announce, whisper or chat" once I have that sorted out I need to extract certain values to be processed. Right now my regex is as follow: ...
6
votes
3answers
461 views

Is there any way to improve (shorten) this F# code?

I have a very good grasp of the syntax and features of F# as well as some of the concepts that mesh well with the language. However, I do not have enough experience writing it to feel comfortable that ...
13
votes
4answers
55k views

Simplify splitting a String into alpha and numeric parts

Requirement: Parse a String into chunks of numeric characters and alpha characters. Alpha characters should be separated from the numeric, other characters should be ignored. Example Data: Input ...
7
votes
2answers
2k views

Slow-running File parser

I've got a method that parses a file. I take all the words and add them to a SortedSet. Every word contains a list of Lines ...
4
votes
1answer
692 views

Parsing random phrases from a file

This essentially reads a specially-structured file from the scanner and then parses random phrases and prints them: ...
4
votes
1answer
317 views

Parse the phone balance from the operator site

How can I write this code better? ...
2
votes
3answers
512 views

Extracting and mangling a parameter from a MySQL configuration file

Is there a better way of doing this? ...
7
votes
2answers
818 views

Scripting language parser

I'm making a scripting language parser and it's shaping up well but it takes about 30ms to do 30 or so odd/even checks. Profiler tells me that it's taking most of ...
4
votes
3answers
1k views

73 Lines of Mayhem - Parse, Sort and Save to CSV in PHP CLI

Inside of a folder named txt I have 138 text files (totaling 349MB) full of email addresses. I have no idea (yet) how many addresses there are. They are separated ...
5
votes
1answer
184 views

Substitution of different occurrences of a string with changing patterns

I need to parse an invalid JSON string in which I find many repetitions of the same key, like the following snippet: ...
7
votes
1answer
2k views

Parser for CNF formulas

I have a parser for CNF formulas in Dimacs format, which is very slow. Any suggestion on how to improve its speed? I did some profiling and I might have to replace ...
12
votes
4answers
2k views

LL(1) tokenizer for LISP

I am trying to write a LISP interpreter in C#, so I started with a tokenizer. I haven't finished it yet (have to handle floating point numbers & symbols), but I already rewrote it two times ...
16
votes
1answer
3k views

House number parsing

I have 2 functions used for parsing a house number and I think these can both be improved. Any suggestions? input: 45a - 47b or ...
30
votes
6answers
80k views

Parsing console application arguments [closed]

In our console app, the parsing of application arguments is done like so: ...
6
votes
3answers
490 views

Javascript Object Placement / String Parsing Method

This JS function is intended to retrieve or place a value into an object with the nested keys as a string. For example ...
9
votes
1answer
694 views

Parsing a game file

Note: This file is out of my hands. I cannot change the format or type of file I have to parse. Here is some sample data that I'm trying to parse. This is information for just one player: ...
17
votes
7answers
2k views

Parsing a file for a game

Is this code good enough, or is it stinky? ...
14
votes
2answers
710 views

HTTP request path parser

I have written a method to tokenize HTTP request paths such as /employee/23/edit: ...

1
20 21 22 23
24