Recent

Author Topic: Reading results of monkeys using Crystal Reports for .txt  (Read 2666 times)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Reading results of monkeys using Crystal Reports for .txt
« on: October 21, 2013, 04:09:13 pm »
... hope I got your attention with the title ;)

Hope I've not been reinventing the wheel, but well..

Suppose you have a text file a bit like this:


some identifying text
another line here
more
stuff
follows

----------------+--------------------+---------------+-------+
a field name    | another field      | yet another   | yes.. |
here            |     name           |  field        | more  |
----------------+--------------------+---------------+-------+
12Oct2012        Traffic ticket       Speeding ticket   500.00
14Oct2012        Parking ticket       Some double yell  100.00
                                      ow somewhere in
                                      Londen
15Oct2012        Traffic ticket       Speeding ticket   200.00
----------------+--------------------+---------------+-------+
This is just an overview of your tickets. It is not a bla
bla bla bla
<form feed or some character>
Some more stuff on page 2 here
more lines
yet more lines
----------------+--------------------+---------------+-------+
a field name    | another field      | yet another   | yes.. |
here            |     name           |  field        | more  |
----------------+--------------------+---------------+-------+
12Oct2012        Traffic ticket       Speeding ticket   500.00
14Oct2012        Parking ticket       Some double yell  100.00
                                      ow somewhere in
                                      Londen
15Oct2012        Traffic ticket       Speeding ticket   200.00
----------------+--------------------+---------------+-------+
and even more texty stuff nobody wants

lines of it.


... basically fixed width, possible multiline records with a record header in a text file.
As if somebody went crazy with a report designer and spat out the results to a text file.

I'm busy writing the following code for it
https://bitbucket.org/reiniero/smalltools/src
directory Bankconvert/semiformattedtext.pas
... and used it to import transaction statements for a Russian bank, sberbank, see:
directory Bankconvert/importfilesberbank.pas

Comments/suggestions welcome

Thanks
« Last Edit: October 21, 2013, 04:11:44 pm 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

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Reading results of monkeys using Crystal Reports for .txt
« Reply #1 on: December 01, 2013, 01:34:30 pm »
Well... I got it working. See banco post in third party announcements
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

 

TinyPortal © 2005-2018