Programming :: Parsing S-Expressions In Python?

Feb 1, 2011

I've been loosely following this:http://norvig.com/lispy.htmlAnd I have a problem: the parsing function throws an array out of bounds exception. I thought that maybe I'm doing it wrong, so I copy and pasted the code from the page, and still the same error

View 2 Replies


ADVERTISEMENT

Programming :: Python - Parsing Data In Chunks / Sections?

Nov 5, 2010

As a curious side project I'm playing with mzXML data(an xml format for holding mass spec data). A typical scan can be quite large, even up into GB size. I'm wondering how would one go about parsing an xml file in sections, one section at a time. The idea being if the computer doesn't have enough memory to load up the entire data file, work on chunks of it at a time.

View 3 Replies View Related

Programming :: Sed Just Can't Get It To Copy Between Expressions

Apr 22, 2010

im trying to get sed to read through a txt document that contains html and cant get it to copy over my code looks like Code: sed -n '/[width=468 height=60 border=0 /></a></center><hr>]/,/[<br clear=left><hr>]/p' 1.txt > 2.txt This is the code that seemed to have the best chance of working but still all it does is copy the whole txt document over instead of between these 2 expressions

View 3 Replies View Related

Programming :: Ant Build.xml And Regular Expressions?

May 31, 2011

i am trying to create an exclude regular expression for my build.xml. The problem is, that i am trying to find some info on which REs are acceptable/valid for ant... Is ant using standard regular expressions? POSIX ones? Since it is a java-based tool, the "Java REs" are probably valid. I am a little bit confused. If somebody can help me out with the different RE standards, i would be most obliged.

View 1 Replies View Related

Programming :: Get The Strings That Matched Sub-expressions?

Jun 8, 2010

Using the regex.h functions, how do you:

1) get the matched strings?

2) get the strings that matched sub-expressions?

View 4 Replies View Related

Programming :: Using Regular Expressions With Find?

Mar 17, 2010

Gidday, I'm puzzled as to why this works:

Code:
find /Data/ -type f -iname "*7pm*"
But this doesn't:
Code:
find /Data/ -type f -regex *7[Pp][Mm]*

I've tried MANY variations, but I'm getting no error messages, just no returns, and yet the first find, will find the sorts of files I'm looking for. I realise a win is a win, but I'm of the understanding that the -regex switch allows for some really complex use of regular expressions - but I can't even get a very simple one to work,

View 4 Replies View Related

Programming :: Make Python Programs Run Without Entering The Command Python?

Mar 22, 2009

I want to be able to do

sudo ./program.py

instead of always having to do

sudo python program.py

What do I need to change?

View 5 Replies View Related

Programming :: Python - Get Text File Data Into An Array On Python?

Nov 30, 2009

I've already used line split stuff to transform my data into something like this in a text file:

Code:

['1', '1', '3', '20.7505207']
['2', '1', '3', '23.0488319']
['3', '1', '3', '-1.5768747']
['4', '1', '3', '-26.4772491']

[code]....

How can I get this on a python program so I can manipulate it as an array?

View 3 Replies View Related

Programming :: Cannot Use Fixed Size Buffers Contained In Unfixed Expressions

Jun 30, 2011

I'm struggling with a C# program to read binary records from a database. The records were created with Borland Delphi. Error: You cannot use fixed size buffers contained in unfixed expressions. Try using the fixed statement.

View 1 Replies View Related

Programming :: Java Regex - Use Regular Expressions Find Out What The First Two Characters Of The String Are

Feb 2, 2011

What I am doing is reading the text from a text document and storing all of the text inside of a ArrayList. I then set one of the values of the Arraylist as a string. I want to use regular expressions find out what the first two characters of the String are. if first two characters = "//" then function(); I only care about the first two characters though. If you need any more information, just ask.

View 4 Replies View Related

Programming :: Python 2.x - Represent The Same In Python 3.x

Mar 4, 2010

I have a function definition in a Python 2.x script which take a tuple as one of its arguments, but 2to3 has no answers nor any of my searching on how to represent the same in Python 3.x

Code:

def blah(self, (string1, string2))

View 4 Replies View Related

Programming :: Parsing Log File With Awk?

Aug 31, 2009

I have logs files from freeradius that have looks as follows:

$ grep "Login incorrect (rlm_ldap: User not found" /var/log/radius/radiusd-inner-tunnel-20090831.log
Mon Aug 31 09:25:27 2009 : Auth: Login incorrect (rlm_ldap: User not found): [John Doe] (from client oficina port 0 via TLS tunnel)

[code]....

I use the following line to get the amount of users that don't exist on ldap:

Code:

grep "Login incorrect (rlm_ldap: User not found" /var/log/radius/radiusd-inner-tunnel-20090831.log | awk '{print $14}' | sort -fu | wc -l

Now, awk on line one for example parses [John Doe] and [Joon Williams] as "[John" and that it's not what I'd want. I mean how could I do for awk looks username field as closed between squared brackets?

View 1 Replies View Related

Programming :: Get Group Name From GID Without Parsing /etc/groups?

Sep 14, 2010

Is there a Linux system call that can be used to get the group name from the GID returned by stat()? I realize that I could parse /etc/groups (if my user had sufficient permissions).

View 3 Replies View Related

Programming :: Parsing Xml File From A C Program?

Mar 14, 2009

i wanted to know how can I pars a xml file (read data from xml file) and from C program.is there any function to do this for me in C.

View 1 Replies View Related

Programming :: Parsing XML Using Sax Parser In Java

Jul 7, 2011

I'll show the code first:

Code:

What I am after is to get the string text from the clip tags. But for now I just tested to see if it can finds the command tags and print something if it does. But it doesn't find it. Anyone knows why ?

Looks like the xml is not good, i test it with a xml validator:

Code:

View 1 Replies View Related

Programming :: Perl: Parsing A Log File?

Nov 9, 2010

I have a log file (test.log) starting & ending within dash (--) as below. I am looking to write a parser for test.log. This test.log file currently has single value for one Job ID but I wish to parse for repeated N values of different Job ID - Job, User, Queue, Dispatched Date, Dispatched Time, Completed Date, Completed Time, Hosts/Processor, CPU_T and TURNAROUND. I can either output this 10 values in another .log file or dump into cgi.

The selected parameters from test.log for parsing with above 10 attributes are -

--
Job <345010>
User <xyz>
Queue <gaussian>

[code]....

View 3 Replies View Related

Programming :: Source Code On Email Parsing In C++ ?

May 11, 2010

Does anyone have source code on Email parsing in C++

View 1 Replies View Related

Programming :: Parsing And Storing Multiple Values Using 'awk'?

Jan 24, 2011

I have a variable in which the data is stored as below:

variable_test=0m0.001s 0m0.001s 0m0.001s 0m0.001s 0m0.001s 0m0.001s .....an so on.

There are lots of values in format like "3m1.057s" are stored in variable_test separated with an space between two such values. For exapmple, value is "3m1.057s" I need to save different parts of a value in three separate array variables such as the

var_hour=3
var_min=1
var_sec= 057

tell if this can be done using "awk". A "WHILE" loop might be used to separate and store theses values I guess?

View 1 Replies View Related

Programming :: Mail Log Parsing Script In Need Of Makeover?

May 30, 2011

I'm working on a script that will parse a mail machine's logs and print a list of email addresses in this format:

authen@domain.com | sender@domain | recipient@domain
exam
account1@domain1.com | sender2@domain2.com |

[code]...

View 2 Replies View Related

Programming :: Parsing Command Line Arguments In PHP?

Feb 1, 2010

I want to know how to get eg. the contents of a form on a webpage which has been passed to a server side PHP script, inside for example an array which I can read. I've been reading a ebook on PHP which as far as I can see doesn't cover this inside it.

View 1 Replies View Related

Programming :: Parsing Datetime Domain Names

Oct 25, 2010

I have spent lots of time trying to figure out how to parse the domain part of this file but am stuck.

How should this be approached:

Code:

Code:

The domains need to be parse at a maximum for 4 levels then the remainder will be put the last field.

View 3 Replies View Related

Programming :: Parsing Out Squid Access Log With Awk And Grep?

Apr 25, 2011

I'm trying to recreate a simple script I wrote to parse out the access.log to get a rough idea of websites that users are going to on our corp network. The issue I'm having is I want to pull out any line from access.log that ends in .com/ .org/ .net/ or whatever to only see what the user entered into the address bar and drop pictures, js's and everything else and log only this. so what I do is :awk '{print $8} | grep -e '[cong]|[ore]|[mgtv][/]'$ and nothing happens.I know there is an easier way to do this with awk alone,

View 8 Replies View Related

Programming :: [C] Parsing Lines Into Chunks And Writing Each Chunk?

Sep 10, 2010

My C foo is terrible! I am working with some code which reads lines from a file and then reformats the lines and writes them to a new file.The input lines look like this:

Code:
+[NEOTEST?]
+[NEOTEST]

[code]...

View 2 Replies View Related

Programming :: Bash Script Position Parameter Does Is Not Parsing '$1'?

Apr 8, 2010

bash script:

Code:
$ bash --version
bash --version
GNU bash, version 3.1.17(2)-release (i486-slackware-linux-gnu)
Copyright (C) 2005 Free Software Foundation, Inc.

Code:
[serv:]$ cat test.sh
#!/bin/bash

[Code]...

The question is, how to config it works through 'function cool {}' or cool() {} with position parameter

View 5 Replies View Related

Programming :: Memory Corruption While Parsing In Multithread Program?

Aug 28, 2009

language: C
OS: linux

I wrote a multithread program(approx 1000 thread have to run) and each thread has to parse a file(for each thread there is one file, ex:thread1 has to parse file1 and thread2 has to parse file2 like this....). I wrote "parse" program as follows. It is working well, if i create 50 threads. but if i run more than 200 thraeds Im getting doublefree corruption as follows:

Code:

*** glibc detected *** ./simulator: double free or corruption (fasttop): 0xb70007b0 ***

And some time I am getting parsing problem and error af follows:

Code:

powersetting.6607:1: parser error : Start tag expected, '<' not found (where powersetting.6607 is file name, when i check this file it is started with '<').

parse program as follows:

Code:

void parse_first(char* filename, int portnum, struct Poweroff *Powerptr1)
{
struct Poweroff *Powerptr;
Powerptr = Powerptr1;

[code]....

View 1 Replies View Related

Programming :: Parsing Unflagged Parameters In Bash Script?

Apr 6, 2010

I've searched online and found many examples using getopts, but nothing that clearly explains it use, nor any examples of what I'm trying to do. I have a script named "process". It can take from 0 to 3 different options. I'd like to be able to handle these options regardless of the order that they are entered.

Syntax:
process [-v] [-d #] [-h|-?] [string]
-v = verbose mode on
-d # = how deep to do the process, expecting a number parameter
-h or -? = show command usage
string = only process lines containing the specified string

[Code]..

View 5 Replies View Related

Programming :: Bash Scripting - Parsing Text File By Character

Aug 11, 2009

Is there a way to process individual characters one-by-one from a text file in Bash, or is that hoping for a little too much from this lovable old clunker?

View 13 Replies View Related

Programming :: Free Open Source CSV Format Parsing Software

Jun 1, 2011

Google directed me to the ones written in .Net/C# etc. Any ideas on the ones written in C/C++?

View 14 Replies View Related

Programming :: Bash Variable Parsing / Extract And Put Into Variables Each Combination Of F1 And F2 In A Loop?

Oct 14, 2010

I have a bash variable where the content looks like this where ;f1; and ;f2; are delimiters:
;f1;field1value1;f2;field2 value1 ;f1;field1value2;f2;field2 value2 ;f1;field1value3;f2;field2 value3

So what I need is to extract and put into variables each combination of f1 and f2 in a loop to something like that:

#first pass of the loop I need:
f1=field1value1
f2=field2 value1

#second pass of the loop I need:
f1=field1value2
f2=field2 value2

# third pass of the loop I need:
f1=field1value3
f2=field2 value3

View 15 Replies View Related

Programming :: Parsing VoIP Call Detail Records (Field Format)

Jan 4, 2010

I am going to parse the Cisco voip CDR(Call Detail Records), please tell me the field format of the CDR files.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved