Hi All,

I'm just wondering, what should be your approach here:

Here's the content of text file:

0022005138450000425081959                091                                 
003200513845161223180000001Doppel-Pack, WET "Warming" & "Original" 0000001499
003200513845161048400000001Handschellen-Set, "Fetish Fantasy"      0000000999
003200513845161214340000001Strap-on, "His Vibrating S(extension)"  0000003999
003200513845000000030000001Versicherung                            0000000099
00220023198100004                        091                                 
003200231981161057180425001Gel-BH, "Romantic"                      0000001000
003200231981161084072250001BESIRED Bustierkleid                    0000002499
003200231981161084050252001BESIRED Trägerloses Minikleid           0000003199
003200231981000000030000001Versicherung                            0000000099
0020219541110000423081969022612303240    091                                 
003021954111161088440203001String                                  0000000799
003021954111161020261420001T-Shirt-BH                              0000001000
003021954111161950540203001Bustier & String                        0000001500
003021954111000000030000001Versicherung                            0000000099
00200000000000005                        091                                 
003000000000161520180220001Balconnet-BH                            0000001000
003000000000161520180226001Balconnet-BH                            0000001000
003000000000161088274520001Push-up, "Rosalie"                      0000001999
003000000000161088274526001Push-up, "Rosalie"                      0000002199
003000000000161071020220001Push-up, "Rokoko"                       0000001999

Now, I want to process these lines per block:

0022005138450000425081959                091                                 
003200513845161223180000001Doppel-Pack, WET "Warming" & "Original" 0000001499
003200513845161048400000001Handschellen-Set, "Fetish Fantasy"      0000000999
003200513845161214340000001Strap-on, "His Vibrating S(extension)"  0000003999
003200513845000000030000001Versicherung                            0000000099
00220023198100004                        091                                 
003200231981161057180425001Gel-BH, "Romantic"                      0000001000
003200231981161084072250001BESIRED Bustierkleid                    0000002499
003200231981161084050252001BESIRED Trägerloses Minikleid           0000003199
003200231981000000030000001Versicherung                            0000000099
0020219541110000423081969022612303240    091                                 
003021954111161088440203001String                                  0000000799
003021954111161020261420001T-Shirt-BH                              0000001000
003021954111161950540203001Bustier & String                        0000001500
003021954111000000030000001Versicherung                            0000000099
00200000000000005                        091                                 
003000000000161520180220001Balconnet-BH                            0000001000
003000000000161520180226001Balconnet-BH                            0000001000
003000000000161088274520001Push-up, "Rosalie"                      0000001999
003000000000161088274526001Push-up, "Rosalie"                      0000002199
003000000000161071020220001Push-up, "Rokoko"                       0000001999

What should be the best approach here?

Thanks in advance.

Recommended Answers

All 2 Replies

First you need to establish what constitutes a block of text.
From what I can see, a block starts with a line ending in 091.
That would be your queue.
Read the text file line by line in a For loop and examine each line to see if it contains that number, with the exeption of the very first line.
Once that's been located, call a method taking the block of text as a argument and perform some kind of action, and resume the iteration when that is done.

Approach to what, are you loading the rows into a database?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.