parsing

VB 2008 - Extracting data from website question

Having more problems coming up with some code for my hwk. All I've been able to do is create the form. We have to get information off of a website and load certain information back into the textboxes on our form. I need a push in the right direction if someone could help. Assignment 6 – Text Parsing Many applications require you to ex...

Create array from the contents of <div> tags in php

I have the contents of a web page assigned to a variable $html Here's an example of the contents of $html: <div class="content">something here</div> <span>something random thrown in <strong>here</strong></span> <div class="content">more stuff</div> How, using PHP can I create an array from that that finds the contents of <div class="...

Get a look at the temporary files a process creates

I'm trying to reverse-engineer a program that does some basic parsing: text in, text out. I've got an executable "reference implementation" and the source code to what must be a different version, since the compiled source output != executable output. The process creates and deletes temporary files very quickly in a multi-step parsing ...

Parse integer from string containing letters and spaces - C#

What is the most efficient way to parse an integer out of a string that contains letters and spaces? Example: I am passed the following string: "RC 272". I want to retrieve 272 from the string. I am using C# and .NET 2.0 framework. ...

Php DOMDocument getting attibute of tag

Hello I have an api response in xml format with a series of items such as this: <item> <title>blah balh</title> <pubDate>Tue, 20 Oct 2009 </pubDate> <media:file date="today" data="example text string"/> </item> I want to use DOMDocument to get the attribute "data" from the tag "media:file". My attempt below doesn't work: $xmldoc = n...

Getting DocumentSteam for html websites without using a Winforms WebBrowser control for parsing?

Getting DocumentSteam for html websites without using a Winforms WebBrowser control for parsing? Is this possible? I would like to create some types like: HtmlDocument doc = new HtmlDocument ("http://www.ms.com"); DocumentStream ds = doc.GetFullStream(); ... Also if possible, please post code. ...

DataBinding with a DataRow - problems

Hello, I am currently coding a project under c# and am experiencing problems. I'll give a brief description of my form: It has a datagridview on the bottom half of the form with single row selection, and is read only. On the top half of the form I have various components which are databound to the selected row on the datagridview. I di...

Get text from HTML

Hi, I need a way to get all text from my aspx files. They may contain javascrip also but I only need this for the HTML code. Basically I need to extract everything on Text or Value attributes, text within code, whatever... Is there any parser API available? Cheers! Alex ...

reading a url and getting back a csv file

i have a URL and when i load it up in a browser it recognizes it as a csv file and pops up excel "do you want to open". I want to do this programatically so i can have a winforms app use that url and parse the csv file directly. what is the quickest way to do this? EDIT: i tried using WebClient and i am getting the folowing erro...

Parsing a text file with Python?

Hello, I have to do an assignment where i have a .txt file that contains something like this p There is no one who loves pain itself, who seeks after it and wants to have it, simply because it is pain... h1 this is another example of what this text file looks like i am suppose to write a python code that parses this text file and c...

Parse a list of attribute/values in PHP.

Given a string with attribute/value pairs such as attr1="some text" attr2 = "some other text" attr3= "some weird !@'#$\"=+ text" the goal is to parse it and output an associative array, in this case: array('attr1' => 'some text', 'attr2' => 'some other text', 'attr3' => 'some weird !@\'#$\"=+ text') Note the inconsisten...

Parser for the Mathematica syntax?

Is there a built parser that I can use from C# that can parse mathematica expressions? I know that I can use the Kernel itself to parse an expression, and use .NET/Link to retrieve the tree structure... But I'm looking for something that doesnt rely on the Kernel. ...

What's the best way of parsing a fixed-width formatted file in Java?

I've got a file from a vendor that has 115 fixed-width fields per line. What's the best way of parsing that file into the 115 fields so I can use them in my code? My first thought is just to make constants for each field like NAME_START_POSITION and NAME_LENGTH and using substring. That just seems ugly so I'm curious if there's any othe...

Parsing variable length descriptors from a byte stream and acting on their type

I'm reading from a byte stream that contains a series of variable length descriptors which I'm representing as various structs/classes in my code. Each descriptor has a fixed length header in common with all the other descriptors, which are used to identify its type. Is there an appropriate model or pattern I can use to best parse and r...

Modify PL/SQL statement strings in C++

Hello all, This is my use case: Input is a string representing an Oracle PL/SQL statement of arbitray complexity. We may assume it's a single statement (not a script). Now, several bits of this input string have to be rewritten. E.g. table names need to be prefixed, aggregate functions in the selection list that don't use a column ali...

CKFinder Parse Error

hey I am trying to use CKFinder in an ASP.NET 2.0 when i upload everything etc and try to use the one in the _sample to see if everything is working with it as standalone i get ERROR 500 'Impossible to load type 'CKFinder.Connector.Connector' ANYONE HAD THE ABOVE PROBLEMS? anyone can help me? ...

Creating a sort of "composable" parser for log files

Hi! I've started a little pet project to parse log files for Team Fortress 2. The log files have an event on each line, such as the following: L 10/23/2009 - 21:03:43: "Mmm... Cycles!<67><STEAM_0:1:4779289><Red>" killed "monkey<77><STEAM_0:0:20001959><Blue>" with "sniperrifle" (customkill "headshot") (attacker_position "1848 813 94") (...

Parsing css with a regex

I'm wanting to scan through a css file and capture both comments and the css. I've came up with a regex that's almost there, however it's not quite perfect as it misses out properties with multiple declarations i.e. ul.menu li a, # Won't capture this line ul.nice-menu li a { text-decoration: none; cursor:pointer; } Here's the regex th...

How to compare two column values which are comma separated values?

I have one table with specific columns, in that there is a column which contains comma separated values like test,exam,result,other. I will pass a string like result,sample,unknown,extras as a parameter to the stored procedure. and then I want to get the related records by checking each and every phrase in this string. For Example: T...

PHP parsing simple_html_dom

Hello, I am stuck with a semi-hard problem with 'simple html dom' (php class used for html parsing). I've used it many times before so I know how to do simple parsing. PROBLEM: $k=0; for ($k = 0; $k < 15; $k++){ $link[$k] = 'www.madeupaddress.com/' . $test[1][$k]; print($link[$k]); $test = file_get_html('$link[$k]'); echo($test); } W...