parsing

parse pdf and identify page a phrase is on

I want to programmatically parse a pdf file, look for certain phrases and find out the page number that each phrase is on. Is this possible (I understand that pdf is not like a text file)? Is so, are there libraries out there that can help? ...

Disabling the PostgreSQL 8.4 tsvector parser's `file` token type

I have some documents that contain sequences such as radio/tested that I would like to return hits in queries like select * from doc where to_tsvector('english',body) @@ to_tsvector('english','radio') Unfortunately, the default parser takes radio/tested as a file token (despite being in a Windows environment), so it doesn't match the ...

add parameter to google query

Hello, I am trying to get the realtime stockquotes from google for some time now. First I try'd the finance api, but that didd'nt work out. Then I saw this query and it seems to good to be true http://www.google.com/finance/info?client=ig&q=goog It must have some drawbacks that I am not aware off now. Anyway, it does give realt...

Parsing dependent requests in an http web response

Hi, I want to simulate the behaviour of the WebTestRequest class (in Visual Studio's Test Tools framework) where it can invoke dependent requests based on resources that are referred to in the response that is obtained from the original request. For example, if I issue a web request and get the response by doing this: string url = "ht...

Convert Hex Char To Int - Is there a better way?

I have written a function to take in the data from a Sirit IDentity MaX AVI reader and parse out the facility code and keycard number. How I am currently doing it works, but is there a better way? Seems little hackish... buff & buf are size 264 buf and buff are char Data received from reader: 2009/12/30 14:56:18 epc0 LN:001 C8...

Parse HEX ASCII into numbers?

I have a H/W device that normally uses a serial port for an interface, sending and receiving binary messages to a PC UI program. I've added an Ethernet port and small TCP/IP stack with a small web server that I want to use to replace the serial port UI with a web browser UI. The messages are mostly request/response sort of things, but f...

jquery - Read a text file?

I have an html file that I'd like to open and read from, but I'm not entirely sure how to do that... Basically, it's a fairly large file (big.html), and, in a separate file (titles.html), I have some jquery code that I'd like to use to find certain elements (namely, h2 tags) and get the inner text from those tags and write just that text...

find and replace backspace in a file with tab using windows batch script

I need to parse a file using windows batch scripts and replace all occurences of backspace (^H) with any other delimiter like tab. I searched in several forums but couldn't find a proper solution. Any ideas are most welcome. ...

Intelligent text parsing and translation

What would be an intelligent way to store text, so that it can be intelligently parsed and translated later on. For example, The employee is outstanding as he can identify his own strengths and weaknesses and is comfortable with himself. The above could be the generic text which is shown to the user prior to evaluation. If the user is ...

XDocument parsing value

In the code snippet below, I only have 1 element in the XML that has text data: <element>like this</element> All the other elements have attributes or nothing. Why would my parsing below seem to indicate that ALL of my elements have "like this" as text data? thx StreamWriter sw = new StreamWriter(out_file_name_); var xd = XDocumen...

Jquery json parsing for select

Hallo, I have this json: { "ROWCOUNT":5, "COLUMNS":["ID","REGIONE"], "DATA":{ "ID":[1,2,4,3,5], "REGIONE":["Abruzzo","Campania","Emilia","Molise","Toscana"] } I want retrieve value from ID and REGIONE with jquery, to fill a select. I have tried this one: for(var COLUMNS in data) { jQuery.each(data[COLUMNS], ...

Intrepreting/Parsing JSON data with jQuery getJSON

I would like to interpret data from JSON feed using jQuery getJSON. $(function() { $.getJSON('http://gdata.youtube.com/feeds/users/raywilliamjohnson/uploads?alt=json-in-script&amp;callback=showMyVideos2&amp;max-results=30', function(data) { $.each(data.feed.entry, function(i, item) { updated = item.updated; ...

parse google search result with asp.net

how i can parse google search result into title, desc and urls? ...

Get Items Feeds4J Java Array

Im from php, so i want to lear java. In php in a for loop if i want to create an array i just do $items = $this->getItems(); for($i=0;$i<count($items);$i++) { $myarrayitems[$i] = $items[$i]; } return $myarrayitems; But in java i got arrayoutofexponsion or like that. here is the code im trying public String[] getItems(String url)...

Building LR(1) configuration lookahead

Hi all, I really have some troubles to cauculate the lookahead when building the LR(1) item sets, i had tried some lecture notes form different sites, but still... My example is S -> E + S | E E -> num | ( S ) The item set is I0: S’ -> . S $ S -> . E + S $ S -> . E $ E -> . num +,$ E -> . ( S ) +,$ I1: S ...

Abort HTMLParser processing in Python

When using the HTMLParser class in Python, is it possible to abort processing within a handle_* function? Early in the processing, I get all the data I need, so it seems like a waste to continue processing. There's an example below of extracting the meta description for a document. from HTMLParser import HTMLParser class MyParser(HTMLP...

Convert a string to an associative array

How would you convert a string like that to an associative array in PHP? key1="value" key2="2nd value" key3="3rd value" ...

Parse xml file while a tag is missing

I try to parse an xml file. The text which is in tags is parsed successfully (or it seems so) but I want to output as the text which is not contained in some tags and the following program just ignores it. from xml.etree.ElementTree import XMLTreeBuilder class HtmlLatex: # The target object of the parser out = '...

What's the best tool to parse log files?

I use grep to parse through my trading apps logs, but it's limited in the sense that I need to visually trawl through the output to see what happened etc. I'm wondering if Perl is a better option? Any good resources to learn log and string parsing with Perl? I'd also believe that Python would be good for this. Perl vs Python vs 'grep o...

XML messages over a TCP/IP socket

I am using C and want to know are XML messages are preferable over text messages as far as communication over a socket connection is concerned? Is there any other good option available rather to go for XML? Which is the best parser(or parsing option) available for parsing XML in C? Is there any standard library which comes with C and ...