parsing

Determine if a string contains a base64 string inside of it

I'm trying to figure out a way to parse out a base64 string from with a larger string. I have the string "Hello <base64 content> World" and I want to be able to parse out the base64 content and convert it back to a string. "Hello Awesome World" Answers in C# preferred. Edit: Updated with a more real example. --abcdef \n Content-Type:...

how to detect strings that end with a number

i am trying to parse out a string and in some cases there is an extra " - [some number]" at the end. for example, instead of showing Technologist it shows Technologist - 23423 i dont want to just check or split on "-" because there are other names that do have a "-" in them can anyone think of a clean way of removing this extr...

Unix command-line JSON parser?

Can anyone recommend a Unix (choose your flavor) JSON parser that could be used to introspect values from a JSON response in a pipeline? ...

objective-c parsing youtube video to see number of views

I'm creating an app that constantly checks the number of views a youtube video has. Is this possible? and how would I do it? Example code, would be awesome :D Thanks, Elijah ...

Parsing a css file with java

Hi all of you..! First I want to explain what am I doing and then my problem. I need to scan a css file and obtain all its internal links(images mainly), but I need to get the line number where the links were found. Right now I am parsing the files using flute library and it works very well also I am using LineNumberReader in order to ...

Feed Parsing In Rails

Hi, I am working on Ubuntu 10.04 and I am using feed-zirra to parse RSS feeds and I have MySQL database. I am trying to parse RSS feeds from Times of India Top Stories. There seems to be problem with the first link, I am sure TOI guys will correct it soon. But anyway, I dont want to face similar error later so thats why I want to ask ...

Advanced Feed Parsing in Rails

Hi, I am a newbie to rails and I have been watching Rails Casts videos. I am interested to know a little bit more on FeedZirra (Rails casts episode 168) and especially feed parsing. For example, I need to Parse feeds from Telegraph and Guardian I want to put all the sports news from both the newspapers in one table, just football new...

Parser in JavaCC and SKIP instruction

Hi, I'm using JavaCC to build a complex parser. At one point, I would like to skip all the character I see until a desired token in my grammar... let's take for example the following /* bla bla bla bla bla bla bla bla */ => I would like to define a kind of grammar like <OPEN_COMMENT> SKIP ~[] until <CLOSE_COMMENT> I want it to be t...

stanford parser usage

Hi! I couldn't find any useful document about how to use stanford-parser with different languages. I read the FAQ page and search the mail archives. There are similar questions on mail list but they weren't answered. The parser uses a file named englishPCFG.ser to parse English sentences. I think this is the file where language specific...

Are there good open-source libraries for parsing search terms from URLs?

I'm looking for a library which parses log files (or incoming requests) and extracts out the search-terms if/when the request came from a search engine. Are there any good libraries which provide this function? Any language will do. ...

parsing an sstream

Hi, I am parsing a file which contains both strings and numerical values. I'd like to process the file field by field, each delimited by a space or an end-of-line character. The ifstream::getline() operation only allows a single delimiting character. What I currently do is thus a getline with the character ' ' as a delimiter, and then m...

Suggestions for parsing this data

So I have a huge file of names that has to be split into more columns for excel. So I am using PHP to parse this, so here is part of the example: Dr. Johnny Apple Seed Ms. A. P. Oranges Mrs. Purple Cup Essentially, I want to put this into an array. I was using fopen, fget, and explode. The problem is, if I use explode, some of the ar...

javascript parser for a string which contains .ini data

Hi, If a string contains a .ini file data , How can I parse it in JavaScript ? Is there any JavaScript parser which will help in this regard? here , typically string contains the content after reading a configuration file. (reading cannot be done through javascript , but somehow I gather .ini info in a string.) ...

Stopping Excel Date Parsing

I've written a script to export product data from a cscart database to a CSV file. It works perfectly, however when opened in MS Excel, it parses things such as "12-14" as dates, which shows "Dec 14". I read http://excel.tips.net/Pages/T003228_Stopping_Date_Parsing_when_Opening_a_CSV_File.html but the client will not be willing to do th...

Reading in text document from a server

I want to be able to store a text document on a server and then read this document when my app launches. I would want to read e.g. a description for an object and item number, and a few urls to images and sound clips. Is reading in and parsing a text document the best way to do it? If so how is it done? Thanks ...

How to convert string to local Date Time?

Hello, I am trying to convert a string of this format: MM/dd/yyyy HH:mm The input is from a US database, so, i.e.: 09/20/2010 14:30 I know that my string is always US time but when I display it, I need to translate that into the local time, so that string should be turned into: 09/20/2010 19:30 (for UK for instance) I tried a few...

How to strip variable spaces in each line of a text file based on special condition - one-liner in Python?

I have some data (text files) that is formatted in the most uneven manner one could think of. I am trying to minimize the amount of manual work on parsing this data. Sample Data : Name Degree CLASS CODE EDU Scores -------------------------------------------------------------------------------------- John M...

Javascript Execution Through Python

I am attempting to create an html document parser with Python. I am very familiar with jQuery and I would like to use its traversing functionality to parse these html files and return the data gathered with jQuery back to my Python program. Is there any way to use javascript scripts through Python? Or is this just a pipe dream? ...

Parsing XML with keys that have spaces in their names

Does anyone know how to parse an xml string in php using SimpleXMLElement when the key has a space in it ? For example, $xmlString = "<test><this is>a</this is></test>"; $xml = new SimpleXMLElement($xmlString); print_r($xml); in the above example, 'this is' causes the parser to go bananas. I'm guessing its because it thinks its a pro...

Change XML in Ipad TopPaid project from mac

Hi, I am trying to modify the TopPaid project from Apple: http://developer.apple.com/library/ios/#samplecode/TopPaid/Introduction/Intro.html I want to put buttons in the Ipad DetailViewController to change the XML, parse again, and reload the table with the new info. What is the correct way of doing this? ...