Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

What should I use to make a log parser?

Name: Sol 2007-01-17 22:03

I wanna make a simple program that will read the log files from scorched earth 3D (as a test, so I can try it again for something much larger), combine the stats (total kills, etc) and display them/possibly output them to a new file.

What langages are best suited for this? I'm already leaning towards C#, but I'm open to suggestions.

Also, note that I want to read already existing logs, not add them as they come up to an already existing database.

Name: Anonymous 2007-01-17 22:05

Might as well use perl.

Name: Sol 2007-01-17 22:52

>>2

Doesn't perl rely on IE or somethin'? (I know nothing of perl)

Name: Anonymous 2007-01-17 23:08

>>3
Apparently not. Read the wikipedia article first... But yes, perl is the best thing for text parsing.

Name: Anonymous 2007-01-17 23:10

>>3
No.  Perl is what is commonly used in CGI though because many web servers have Perl interpreters, but it is in no way dependent on them or IE.

Name: Anonymous 2007-01-18 0:40

For processing text? C# has less chance against Perl than an icecube does an oven.

Name: Sol 2007-01-18 1:56

Alright, got perl (this... ActiveState thingy anyway) and installed it.

Frankly I'm relieved; C# was gonna be a pain in the ass. But now I'm confused; the only thing I'm seeing that has been installed is this "Perl Package Manager" thing that, upon running, says it's trying to synchronize with something and immediately locks up.

What the hell?

Name: Sol 2007-01-18 1:58

eh, nix that, it just took a while to load.

Still, what do I do know? 

Name: Anonymous 2007-01-18 2:39

oh... i don't know... learn perl?!

Name: Anonymous 2007-01-18 4:00

For text processing the best is Perl... Write-once text processing, that is. If you plan on maintaining what you do and might need to change in the future, consider Python.

Name: Anonymous 2007-01-18 14:29

>>10
Python's regex suck. If he's going to use Python for it, he might as well use C#; they both take the library approach.

Name: sol 2007-01-18 15:16

>>9
>oh... i don't know... learn perl?!

Brilliant!

I say we celebrate with a Mike's Hard Lemonade!


Okay, so I've found an IDE (perlIDE, from sourceforge) and I've spent a few hours browsing through perl links and documents, and while a lot of the commands are sorta simple to see what they're doing, the syntax and expressions are confusing the hell out of me. All the so-called "tutorials" are anything but; it's like they're all hinting at expressions and references and otherwise basic termonologies that I can't seem to find explanations for.

tl;dr: I'm an idiot. How do I learned perl?

Name: Anonymous 2007-01-18 15:20

Yes, I use Haskell. So? I dont see any problem. I embraced arrows long ago and I am happy together with my compiler/interpreter (which is GHC/i!). We have no friends because no one can understand our code but I am pretty slim and nerdy looking.

But thanks anyway asshole. Go and write your shitty verbose languages while I achieve satori and write Hello, world! programs over and over again.

Name: Anonymous 2007-01-18 22:17

use C. not C++ or C#, just C. it's very fast. possibly faster than fortran.

Name: Anonymous 2007-01-19 2:17 (sage)

>>14
depends on which fortran compiler

Name: Anonymous 2007-01-19 5:18

>>11
I agree that Python's regex taking the OO library approach suck, that's why I made my simple regex module which does all the shit for you. You only have to call match(regex, haystack [, flags_in_a_string]) and receive a tuple with the matches (\0, \1, \2...), or replace(regex, replacement, haystack [, flags]). I can post it if somebody's interested.

Name: Anonymous 2007-01-19 9:04

>>16
Interested!

Name: Anonymous 2007-01-19 14:08 (sage)

>>16
why not use a real language like perl, c, or javascript instead of some toy language that doesn't handle regexes in a sane way?

Name: Anonymous 2007-01-19 14:42

cat filename | grep 'desired field'

Name: Anonymous 2007-01-19 15:07

PERL

Name: Anonymous 2007-01-19 22:26

>>12

First of all, ditch that IDE.  Get Eclipse, and the EPIC perl plugin.  Its name befits a 4chan programmer.

Then, just start looking at a bunch of googled Perl examples.  The language almost reads like english when done right, so you really shouldn't need anything too in depth.

Depending on the log file used, you will either want to use a regex (most things), finite state machine (uber-complex), or unpack (fixed length).

http://perldoc.perl.org/perl.html

Name: Anonymous 2007-01-19 23:34

chomps() thread

Name: Anonymous 2007-01-20 20:33

>>17
Ok, I finally got myself to create a site to post my shit, so I'll be posting shit there. It's a Google Pages site because I'm lazy as fuck and don't have time to write a better one, but it serves the purpose just fine. The stuff you want is "wre, a simple regular expression interface". Hope it's helpful.

http://wiseman1024.googlepages.com/

Name: Anonymous 2007-01-20 20:34

>>23
BTW, the name of the site sucks. If you can think of a better name, let me know.

Name: Anonymous 2007-01-21 7:04

>>23
the name of the site sucks. If you can think of a better name, don't let him know, it will be more lulz!

Name: Anonymous 2007-01-21 7:57

>>25
By lulz, do you mean lulz or desu?

Name: Anonymous 2007-01-21 9:26

>>25
Yeah, I'm terrible choosing names, and I didn't want to use some 4chan inside joke that would make the site look weird/not serious, more than I already did with sauce. I had considered "In before download" or "SAUCE PLZ".

Name: Anonymous 2009-01-14 13:46

VALID PERL CODE

Name: Anonymous 2012-03-23 23:33

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boyAll work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boyAll work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boyAll work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boyAll work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boyAll work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boyAll work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

All work and no play makes Jack a dull boy

Name: Sgt.Kabu즋⑎kiman拀␡ 2012-05-28 22:08

Bringing /prog/ back to its people
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy

Don't change these.
Name: Email:
Entire Thread Thread List