Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Browsers ,vim Vs. Emacs etc....

From: petr:krenzelok:trz:cz at: 17-Mar-2002 1:11

Joel Neely wrote:
>Since much data from mainframes, or obtained via OCR (from TSU/SSU >sources, of course! ;-), is in fixed-record layout, it would be >interesting to have a program that would attempt to infer "field" >positions and lengths by examining the content of the data. >
Hmm, what is the problem? :-) I did some work here. We use CICS systems in our company (till we move fully to SAP R3). Guys prepare download/job for us, it is on AIX side, and we download it using http (I just wrapped our programmer's solution, as they suggested to download my files manually using IE) .....
>This would involve a heuristic approach IMHO. > >There are "horizontal" issues, such as the fact that alphanumeric >fields (e.g. names and addresses) are typically left-justified >and right-padded with blanks, while numeric fields are typically >either right-justified or decimal-position aligned, and left- >padded with either zeros or blanks. >
Yes, and there is no problem, is there any? The record has fixed length field structure and that is important. Anyway, what we do is - we import (append) such data into .dbf files (simple one command in foxpro/clipper - "use empty.dbf", "append from downloaded.txt" ... One day I needed to do some stuff and I wanted to use Rebol. So I opened our dbf maintaining tool, and exported structure by typing "copy stru to struct.txt". It nicely prints structure to the text file, telling me filed names, field types, their length, etc. I created small function, which parses such definition file and I called it "stru: get-structure struct.txt". It returns rebol object. Then I use "read/lines" in rebol and "foreach record file [rec: map-object stru record .....]" to process the file. I don't do any automatic type conversion, as I don't need it yet, but there is no problem making 'map-object function clever enough to do some type conversion ...
>There are also "vertical" issues, in that a series of lines with >the same content in the same position(s) probably contain hints >about the fields. When trailing blanks (after alphanumeric data) >in some lines are replaced with alphanumeric data and fewer >trailing blanks, that's a hint of a variable alphanumeric field. > >etc... > >Wouldn't REBOL be a good tool to write such a sort-of-AI task in? >
Well, I either don't understand the problem correctly, or I just can find out, why to call such trivial task being an AI issue :-) With Rebol, it is fun, not an AI :-)
>Wouldn't that make an interesting demonstration of the power of >REBOL for the commercial/business environment? >
business environments use SQL or ODBC imo or XBase tools at least imo .... Cheers, -pekr-