I am working working with very large XML files (100s of MBs). The tree is fairly simple
<items>
<item>
<column1>ABC</column1>
<column2>DEF</column2>
</item>
<item>
<column1>GHI</column1>
<column2>KLM</column2>
</item>
</items>
I need to parse this document, and remove some <item> elements. So far, the best peer...
I have a string in this format: "ABC_123_"
I want to end up with and integer variable that is just the number portion of the string. What is the most efficient way to accomplish that in C#?
...
I have an XML document (generated by Adobe XFA forms), that contains data like the following:
<Position>
<PositionBorder>
<Title/>
<StartDate/>
<EndDate/>
</PositionBorder>
</Position>
Since this file is defined elsewhere, I am not at liberty to change the format of the XML that I get.
In my Java code, I cr...
Hi,
In VB.net I'm trying to read in a specific line from a file. An example of the line in the txt file is:
[PATH] = "/this/directory/run.exe"
Now I understand how to open the file for reading and writing in VB, but I need to parse out the path in the "" (quotation marks). Any help would be greatly appreciated!!
--Adam
...
I'm trying to create a parser for a simple language with the lemon port to PHP, and it works, almost.
The following grammar:
%name SP_
%declare_class { class SpecParser }
%token_prefix SP_
%include_class {
public $retvalue = '<todo: error handling>';
public function singleKey($elem) {
end($elem);
return key($elem);
}
}
%pa...
This has been something that's been bothering me for a while. How does one go about parsing the following text into the HTML below using ANTLR? I can't seem to wrap my head around this at all.
Any Ideas?
Markdown:
> first line
> second line
> blockquote>
<p>first line
second line</p>
<blockquote>
<p>nested quote</p>
</b...
Initially I was thinking to use SSIS to parse an EDI file, however I've seen a few manual EDI parsers (field mapping), and would like to use automate this functionality in C#.
EDI file - ie: http://www.altova.com/images/shots/edi_source3.gif
Tips appreciated.
Thanks.
...
Exactly as the title asks:
How would I remove all unnecessary spaces between single quotes skipping escaped quotes in PHP?
I am looking for a fast implementation to pre-prep for parsing. I would prefer not to use regex if it would be slower than using a simple loop.
(The double quotes below are for display purposes only)
examples wo...
Hi
I want to put all attributes in a Html element into an array:
like i have a jQuery Object, whichs html looks like this:
<span name="test" message="test2"></span>
now one way is to use the xml parser described here, but then i need to know how to get the html code of my object.
the other way is to make it with jquery, but how?
the...
Hello folks,
I'm having a bit of trouble manually emitting a token with a lexer rule in ANTLR. I know that the emit() function needs to be used but there seems to be a distinct lack of documentation about this. Does anybody have a good example of how to do this?
The ANTLR book gives a good example of how you need to do this to parse ...
Following hot on the heels of my question about how to read from a line in vb .net, I need to do the following:
change the line in a text file
[Path] = "c:\this\certain\path\"
with this line
[Path] = "c:\that\other\newer\path\"
these paths will most certainly be different lengths, so I need to either replace what's in the quotes ...
Hello, Again a question. This time I'm parsing XML messages I receive from a server.
Someone thought to be smart and decided to place HTML pages in a XML message. Now I'm kind of facing problems because I want to extract that HTML page as a string from this XML message.
Ok this is the XML message I'm parsing:
<AmigoRequest>
<From></Fr...
How can I use struct.unpack() or some other function available in Python to easily convert one byte variable to a Python integer? Right now, it is done in a rather lame way:
file = open("telemetry.dat", "rb").read()
magic = file[0]
int(binascii.hexlify(magic), 16)
Is there another?
...
- (void)parserDidStartDocument:(NSXMLParser *)parser
{
nestedChannels = [ [ NSMutableArray alloc ] init ];
....
}
- (void)parser:(NSXMLParser *)parser didStartElement....
{
Channel *channel = [ [ Channel alloc ] init ];
[ nestedChannels addObject:channel ];
....
}
- (void)parser:(NSXMLParser *)parser foundCharacters...
I'm writing a script in Python that will allow the user to input a string, which will be a command that instructs the script to perform a specific action. For the sake of argument, I'll say my command list is:
lock
read
write
request
log
Now, I want the user to be able to enter the word "log" and it will peform a specific action, whi...
Hi Folks,
I have a command that formats it's output in the form of CSV. I have a list of machine this command will run against using a foreach loop. in the below example $serverlist is automatically generated with an AD Query.
foreach ($server in $serverlist) {
$outputlist = mycommand
}
what I would like to do is somehow end up wit...
Hello,
I am quite new to the iphone development,
I am using xml parsing to parse contents of a feed
this feed contains this line
<enclosure url="http://www.abc.com/wp-content/uploads/2010/01/abc.jpg" length="64690" type="image/jpg" />
no I want to extract http://www.abc.com/wp-content/uploads/2010/01/abc.jpg
XML structure is like t...
This would be part of a reverse-engineering project.
To determine and document what a shell script (ksh, bash, sh) does, it is comfortable, if you have information about what other programs/scripts it calls.
How could one automate this task? Do you know any program or framework that can parse a shell script? This way for instance, I co...
I would like to read and write n bits from/to binary files.
For example, read the next n bits into an integer or the next n bits
to a char. I need the data to be bit aligned and not byte aligned.
Are there C++ libraries that allow me to do that?
When I use ostream/istream, I seem to be restricted to using byte aligned
data. This is no...
I have large strings that resemble the following...
some_text_token
24.325973 -20.638823
-1.964366 0.753947
-1.290811 -3.547422
0.813014 -3.547227
0.472015 3.723311
-0.719116 3.676793
other_text_token
24.325973 20.638823
-1.964366 0.753947
-1.290811 -3.547422
-1.996611 -2.877422
0.813014 -3.547227
1.63236...