| Pages: [1] :: one page |
| Author |
Thread Statistics | Show CCP posts - 0 post(s) |

Joseph 9
Digital Fury Corporation Digital Renegades
|
Posted - 2008.02.12 21:43:00 -
[1]
I'm feeling lazy so I can't be bothered to register on a programming forum and I can't find any of my reference books at the moment so I've decided to question the swathe of geeks that populate these forums.
Is anyone aware of a function that replicates the functionality of regexp in C or C++. I'm looking to build a small console application for windows that you drop in to a driectory full of files containing some standard filename components (shot# and channel##, # 0-9) and run. It then analyses them and throws out a new file as an output.
|

Joseph 9
Digital Fury Corporation Digital Renegades
|
Posted - 2008.02.12 22:18:00 -
[2]
That bad is it? 
|

Tarminic
Forsaken Resistance The Last Stand
|
Posted - 2008.02.12 22:21:00 -
[3]
If it was Java or PHP I could help you out, but sadly my experience with C++ is limited and none of that experience involved regular expressions.  ---------------- Tarminic - 32 Million SP in Forum Warfare Play EVE: Downtime Madness v0.78.3 (NEW VERSION!) |

Calderio
Caldari Black Nova Corp Band of Brothers
|
Posted - 2008.02.12 22:25:00 -
[4]
I was drinking when I had to take c and c+, I can force out some code after a few drinks, but not what your looking for.
Click The Power Of BOB Compells you |

Joseph 9
Digital Fury Corporation Digital Renegades
|
Posted - 2008.02.12 22:29:00 -
[5]
Edited by: Joseph 9 on 12/02/2008 22:32:26 Actually Tarmic, how hard would it be to do what I want in PHP? Essentially I have a selection of arbitrary but similar filenames with certain common components. So I know if I find ch01 then I need to chase up all ch## till I can find no more, haul in the data, process it, build a new file and then spit it out, named in the same style as the original files, i.e. I'll just strip out the ch01 component of the first file name and use that as the end products name.
P.S. I don't know PHP so I'd need to learn it, so maybe factor that in.
|

Rialtor
Amarr Yarrrateers Knights Of Syndicate
|
Posted - 2008.02.12 22:46:00 -
[6]
Edited by: Rialtor on 12/02/2008 22:54:13 It's not native to C++, so you'll need some 3rd party library out there.
there's one on Boost.org
Boost Libraries
Haven't really used it, but RegEx Libraries are pretty much all the same.
Edit: If you don't want to do that, you could look up how to launch executables in c++. Create something in Perl, then call that perl program in c++. The library is probably easier though.
---- sig ----
Never doubt that a small group of thoughtful, committed citizens can change the world... Indeed, it's the only thing that ever has. |

Shameless Avenger
|
Posted - 2008.02.12 22:53:00 -
[7]
PERL is the king!
Rescue and old computer from the dumpster.
Install a linux distro.
Mount the Windows drives via Samba
Write a 10liner to manipulate your files and feed them to whatever other process you have.
But that's just me. |

Isiskhan
Gnostic Misanthropy
|
Posted - 2008.02.13 01:09:00 -
[8]
Perl is the perfect language for these sort of tasks indeed. It's also available for Windows, and the basic syntax borrows a lot from C. It features the most seamless integration of regexps you'll find in any language, and it also plays very nicely with other commands (launching them and capturing their output divided by lines into an array is a simple one-liner, for instance). It's not for nothing that Perl used be called the "duct-tape of the internet".
If it's not too complex and you use Linux, you could probably do this without even resorting to a script though, just by using some cat / sort / find (it supports regexps), etc. and joining them by pipes on a single command line.
|

Frezik
Basically Outdated Stereo Equiptment
|
Posted - 2008.02.13 03:26:00 -
[9]
As noted above, Perl is the first choice for these sorts of file processing tasks. C/C++ will force you to deal with unnecessary details, and PHP tends to fall apart whenever you bring it outside fuzzy web scripter land. If you don't want to use Linux for the task, download Cygwin, which gives you a Unix-like environment under Windows (including Perl).
If you really want to use C, track down the pcre library (Perl Compatible Regular Expressions).
*Resist going on rant about intelligence of PHP programmers*
|

Ryysa
Caldari
|
Posted - 2008.02.13 11:07:00 -
[10]
Originally by: Frezik *PHP programmers*
You mean script monkeys? 
EW Guide - KB Tool - My Music |

Shameless Avenger
|
Posted - 2008.02.13 11:25:00 -
[11]
Originally by: Ryysa
Originally by: Frezik *PHP programmers*
You mean script monkeys? 
No, he mean web script monkeys there's a difference |

Victor Valka
Caldari Kissaki Corporation
|
Posted - 2008.02.13 12:53:00 -
[12]
Originally by: Ryysa
Originally by: Frezik *PHP programmers*
You mean script monkeys? 
Is that a step above or below 'scrip kiddy'? Or is it on the same level but different hierarchy tree?
|
| |
|
| Pages: [1] :: one page |
| First page | Previous page | Next page | Last page |