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

[REBOL] Need help from parsing professionals

From: moeller_thorsten:gmx at: 27-Jul-2001 12:36

Hi, it is obviously not a big thing. I have a big string. from this string i need to make a readable file with lots of lines. So every line starts with AA...... The Line ends when the next Line with AA comes up. What i tried now was following: a: read %/c/temp/test.txt parse a [any [to "AA201" mark: to "AA" (write/append %/c/temp/new.txt join mark "^/")]] This seems to run in an endless loop and looking in the new.txt it shows, that the parser didn't recognise the "AA201", because he always adds the whole big string in one part, not the parts of the string as lines. Here are some sample lines for testing: AA2012001070107120006600000300002DIV 1015940000000000000000000000000001106725000010711010711AR 000 BUCHUNG TS1000000001301,84+00000000179,56-00000000000,00 001 016,0000000000000,00 DE118904627 00000000000,00+00000000000,00-00000000000,00 00000,000000 0000000000 EDV RE. KUNDE 000000000000,00 00000000000000000000000000000000000000000000000000000001400000,0000000,00000 000000000000000000000000001301,84+00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107120006600000200001SAB 0000081080000000000000000000000001106724000010711010711AR 000 GEGENB. AU2000000012419,49-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000012419,49-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107060006520013100056SAB 0000082010000000000000000000000002113237000010705010705AR 000 GEGENB. AU2000000000305,11-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000000305,11-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107060006520013000056SAB 0000081010000000000000000000000002113237000010705010705AR 000 GEGENB. AU2000000000012,20-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000000012,20-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107060006520012900056DIV 1011580000000000000000000000000002113237000010705010705AR 000 BUCHUNG TS1000000000368,08+00000000050,77-00000000000,00 001 016,0000000000000,00 DE118904627 00000000000,00+00000000000,00-00000000000,00 00000,000000 0000000000 EDV RE. KUNDE 000000000000,00 00000000000000000000000000000000000000000000000000000001400000,0000000,00000 000000000000000000000000000368,08+00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107060006520012800055SAB 0000082010000000000000000000000002113236000010705010705AR 000 GEGENB. AU2000000001067,89-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000001067,89-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107070006540034500151SAB 0000082010000000000000000000000002113489000010706010706AR 000 GEGENB. AU2000000000043,57-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000000043,57-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107030006460001200006SAB 0000082030000000000000000000000002112927000010702010702AR 000 GEGENB. AU2000000006166,19-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000006166,19-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107130006620002000010SAB 0000081010000000000000000000000001106737000010712010712AR 000 GEGENB. AU2000000029139,56-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000029139,56-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107050006500005800028SAB 0000081010000000000000000000000002113149000010704010704AR 000 GEGENB. AU2000000000012,20-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000000012,20-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107070006540013500064SAB 0000082010000000000000000000000002113399000010706010706AR 000 GEGENB. AU2000000001645,97-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000001645,97-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107070006540013400064DIV 1032006600000000000000000000000002113399000010706010706AR 000 BUCHUNG TS1000000001909,33+00000000263,36-00000000000,00 001 016,0000000000000,00 DE118904627 00000000000,00+00000000000,00-00000000000,00 00000,000000 0000000000 EDV RE. KUNDE 000000000000,00 00000000000000000000000000000000000000000000000000000000100000,0000000,00000 000000000000000000000000001909,33+00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107070006540013300063SAB 0000082010000000000000000000000002113398000010706010706AR 000 GEGENB. AU2000000000250,88-00000000000,00 00000000000,00 000 000,0000000000000,00 00000000000,00 00000000000,00 00000000000,00 000000000000 000000000 0 - 00000000000000000000000000000000000000000000000000000000000000,0000000,00000 000000000000000000000000000250,88-00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 AA2012001070107060006520034400147DIV 1042320800000000000000000000000002113329000010705010705AR 000 BUCHUNG TS1000000000028,35+00000000003,91-00000000000,00 001 016,0000000000000,00 DE118904627 00000000000,00+00000000000,00-00000000000,00 00000,000000 0000000000 EDV RE. KUNDE 000000000000,00 00000000000000000000000000000000000000000000000000000001000000,0000000,00000 000000000000000000000000000000,00+00000000000,00 00000000000,00 00000000000000000000 000000000000 000000 000000 0000000 0 Any ideas??? Thorsten