Recent

Author Topic: Text processing in Object Pascal?  (Read 2733 times)

vicot

  • Full Member
  • ***
  • Posts: 114
Text processing in Object Pascal?
« on: July 04, 2013, 09:57:11 am »
I am a newbie.
Are there good text processing tools in Object Pascal?

I really need it for simple tasks, and I don't want to learn awk, sed or Perl!

So far, I was not able to find any specific reference to text processing for Object Pascal.

Maybe you can help me.

Thanks


jarto

  • Full Member
  • ***
  • Posts: 106
Re: Text processing in Object Pascal?
« Reply #1 on: July 04, 2013, 10:00:56 am »
Here's the basics:

http://lazarus-ccr.sourceforge.net/docs/rtl/strutils/index-5.html
http://www.freepascal.org/docs-html/rtl/system/stringfunctions.html

It'd be nice if you could describe in more detail, what you are looking for.
« Last Edit: July 04, 2013, 10:05:17 am by jarto »

vicot

  • Full Member
  • ***
  • Posts: 114
Re: Text processing in Object Pascal?
« Reply #2 on: July 04, 2013, 10:07:53 am »
Thanks

Hm, from the link you gave me it seems that only the most basic string functions are supported.

Are more complex pattern-based functions supported (pehaps via a third-party component)? Such as regular expressions, for example. Or some other pattern-based functionality.

What I need it for is:
finding strings according to patterns, splitting up files according to patterns, etc.

Does anyone do these things in Object Pascal?

Or do you advise me to use another language instead?

Thanks again

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Text processing in Object Pascal?
« Reply #3 on: July 04, 2013, 10:18:03 am »
I would advise you to search the wiki and documentation a bit.
E.g. see here for some info on regex:
http://wiki.lazarus.freepascal.org/Regexpr

Edit: on the forum, you'll also find many threads regarding these subject, but searching for them is perhaps not so easy. People have been posting about searching for a particular set of bytes in a binary file etc.

(Object) Pascal is fine for text processing but it is a general purpose language. Perhaps a language specifically focussed on text processing (perl?) may be quicker/faster for you. Also depends on taste.
« Last Edit: July 04, 2013, 10:19:36 am by BigChimp »
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Leledumbo

  • Hero Member
  • *****
  • Posts: 8819
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Text processing in Object Pascal?
« Reply #4 on: July 04, 2013, 10:56:09 am »
Quote
What I need it for is:
finding strings according to patterns, splitting up files according to patterns, etc.
Open your fpc/packages/regexpr and check yourself. The current version is based on Sorokin's TRegExpr AFAIK so you can read its documentation as a reference.

 

TinyPortal © 2005-2018