Home   Archive   Permalink

Newbie help

I had a simple request to get info from our SAP production system and compare 2 files and output the differences of text. I've done it using ABAP in my dev client, but how would I do it in REBOL?
The record format for file 1 is fixed:
"201185242118524211PERMIT SUPPORT SERVICES DIV 1000SP01A2"
The record format for file 2 is: "852421120100701BUD DEV-HAZ WASZTE SITE CLEANUP"
I need to read the file to get only those with the first 4 of "2011" and the last 2 of "A2".
Then, I need to compare user the next 7 characters, which is the cost center, to the same cost center in file 2 and compare the text. Differences in are outputted. This is all upper case, so that isn't a problem.
I think I've got how to read the file and search thru another file for matches, but how do I split/parse file 1's record into fields I can use?
I don't seem to "get it." Thanks!!

posted by:   Steve Oldner       17-May-2010/8:16:17-7:00

Use copy and copy/part:
     file1: "201185242118524211PERMIT SUPPORT SERVICES DIV 1000SP01A2"
     copy/part file1 4
     copy at tail file1 -2
     copy/part (at file1 9) 7
Take a look at http://re-bol.com/rebol_crash_course.html#section-2.3 and the "REBOL strings" section.

posted by:   Nick       17-May-2010/10:07:06-7:00

Thanks Nick! And better still if your course!
I am a fan...

posted by:   Steve Oldner       17-May-2010/10:57:06-7:00