parsing

How to convert a string pointer to a 64bit ( _int64) variable??

As I wrote an app with the function main(int argc, char * argv[]) When i start up the application, I wanna send some parameters like (assume the app name is ffdisk) >ffdisk -f 111123123131321312312123 1 You see the third param maybe an int64 param in my original intention... But in function main, argv[2] is string pointer, so how can...

Need a good HTML parser on php

Found this one http://simplehtmldom.sourceforge.net/ but it has failed to work extracting this page http://php.net/manual/en/function.curl-setopt.php and parse it to plain html, it failed and returned a partial html page This is what I want to do, Go to a html page and get the components individual( the contents of all div and p in a...

regular expression to parse links from html code

Possible Duplicate: Regex to get the link in href. [asp.net] I'm working on a method that accepts a string (html code) and returns an array that contains all the links contained with in. I've seen a few options for things like html ability pack but It seems a little more complicated than this project calls for I'm also interes...

Parse/Shred Huge Complex XML to SQL Server 2008 Database (30+ tables)

I read this already: http://stackoverflow.com/questions/61233/the-best-way-to-shred-xml-data-into-sql-server-database-columns and http://stackoverflow.com/questions/223376/looking-for-a-good-bulk-insert-xml-shredding-example-for-sql-2005. The differences of why I'm posting is that I'm using BizTalk 2009 and SQL 2008. I'm receiving ...

Finding the first number in a string using .NET 3.5

I have a bunch of strings I need to extract numbers from. They're in the format: XXXX001 XXXXXXX004 XX0234X There's a lot of these, and i need to loop over them all and extract all the numbers. So what's the quickest/most efficient way, using ASP.NET 3.5, to find the first instance of a number within a string? Update I should've inc...

How can I break an url and store the key-words into database using php

Like http:webmail.wipro.com#a:?b; I want to break this url and store only webmail and wipro into my database. Can any one help me out with this please. Using php. ...

c# : parsing text from html

I have an string input-buffer that contains html. That html contains a lot of text, including some stuff I want to parse. What I'm actually looking for are the lines like this : "< strong>Filename< /strong>: yadayada.thisandthat.doc< /p>" (Although position and amount of whitespace / semicolons is variable) What's the best way to get a...

Use Python to insert xml markup around the difference of two strings

I have an oldstring: 'foobarba <span class="foo">z</span>' and a newstring: 'foodbar ba<span class="foo">z</span>' a string is given for a classname, it could be "foo" again, let's say "bar". Given newstring, oldstring and bar, I want to end up with: 'foo<span class="bar">d</span> ba<span class="foo">z</span>' I want to diff th...

Sax parser: Ignoring HTML

Hello, I am using the sax parser to parse a XML file. It works fine, but I don't want to parse the content of an <info> tag as it contains HTML which I want to save to a string. Can anyone tell me is there any way to go about doing this?. Thanks ...

XML parsing iPhone

Hi Guys, I am having this string: [?xml version="1.0" encoding="UTF-8"?] SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:methods" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="urn:PingdomAPI" xmlns:SOAP-ENC="http://schemas.x...

HTML Agility Pack

Hi All I'm trying to use HTML Agility Pack to get the description text from inside the: <meta name="description" content="**this is the text i want to extract and store in a string**" /> And someone on Stackoverflow a little while ago suggested I use HTMLAgilityPack. But I don't know how to use it, and the documentation for it that I...

PHP Simple HTML DOM Parser problem with split()

I want to use the PHP Simple HTML DOM Parser to display all my Left4Dead Steam achievements on my website. The achievements list on the steam community website looks something like this: <img src="…" /><br /> <div class="achieveImgHolder"><img src="…" /></div> <div class="achieveTxtHolder"> <img src="…" /> <div class="achieveTxt"> <...

Parsing multilevel text list

I need to parse text lists: 1 List name 1 item 2 item 3 item 2 List name 1 item 2 item 3 item 3 List name 1 item 2 item 3 item I was trying to use regular expression to split first level list: import re def re_show(pat, s): print re.compile(pat, re.S).sub("{\g<0>}", s),'\n' s = ''' 1 List name 1 item 2 item 3 item 2 List nam...

Is it possible to create a generic JSON parser ?

What I mean by generic is that you pass a class and a JSON to a method and that method transforms the JSON data in your object based on the class definition. I'm interested both in conceptual answers and Objective-C approaches. ...

Get XML from https URL

I'm trying to get data from multiple XML feeds and copy that data to my local database. I've tried looking into SimpleXML and some other things I've found on the internet but I'm wondering what the best route to take with something like this. I'm looking for something that will not only get the XML from the secure location but also con...

What do people mean when they say “Perl is very good at parsing”?

What do people mean when they say "Perl is very good at parsing"? How is Perl any better or more powerful than other scripting languages such as Python or Ruby? ...

What is the difference between an Abstract Syntax Tree and a Concrete Syntax Tree?

I've been reading a bit about how interpreters/compilers work, and one area where I'm getting confused is the difference between an AST and a CST. My understanding is that the parser makes a CST, hands it to the semantic analyzer which turns it into an AST. However, my understanding is that the semantic analyzer simply ensures that rul...

Example code for dynamic parsing techniques

I would like to learn how to write dynamic parsers to perform tasks such as code-completion, highlighting, etc. I have read the dragon book and written some parsers, but I would like more experience with handling incorrect code, especially code as it is being written. IDEs like Eclipse and NetBeans obviously include code for stuff like...

Intelligent RegEx in Perl?

Background Consider the following input: <Foo Bar="bar" Baz="1" Bax="bax" > After processing, I need it to look like the following: <Foo Bar="bar" Baz="1" Bax="bax" CustomAttribute="TRUE" > Implementation This is all I need to do for no more than 5 files, so using anything other than a regular expr...

Sax parsing and encoding

I have a contact that is experiencing trouble with SAX when parsing RSS and Atom files. According to him, it's as if text coming from the Item elements is truncated at an apostrophe or sometimes an accented character. There seems to be a problem with encoding too. I've given SAX a try and I have some truncating taking place too but have...