Multi-line text file import to Excel

W

Waxaholic

I need some guidance on how to handle a multi-line text file import to
excel.

I have a multi-line text file i am attempting to parse into Excel2003.
Here is an example of the file:

<rlnrp:cell=all;
NEIGHBOUR RELATION DATA

CELL
WA32300

CELLR DIR CAND CS
WA31340 MUTUAL BOTH NO

KHYST KOFFSETP KOFFSETN LHYST LOFFSETP LOFFSETN
3 0 3 0

TRHYST TROFFSETP TROFFSETN AWOFFSET BQOFFSET
2 0 5 3

HIHYST LOHYST OFFSETP OFFSETN BQOFFSETAFR
5 3 0 3

CELLR DIR CAND CS
WA30780 MUTUAL BOTH NO

KHYST KOFFSETP KOFFSETN LHYST LOFFSETP LOFFSETN
3 0 3 0

TRHYST TROFFSETP TROFFSETN AWOFFSET BQOFFSET
2 0 5 3

HIHYST LOHYST OFFSETP OFFSETN BQOFFSETAFR
5 3 0 3

CELL
WA30433

CELLR DIR CAND CS
WA31960 MUTUAL BOTH NO

KHYST KOFFSETP KOFFSETN LHYST LOFFSETP LOFFSETN
3 0 3 0

TRHYST TROFFSETP TROFFSETN AWOFFSET BQOFFSET
2 0 5 3

HIHYST LOHYST OFFSETP OFFSETN BQOFFSETAFR
5 3 0 3

END

---------------------------------------------------------------
Details of where i am trying to go with this:

The format of the source file is not modifiable so i am left to deal
with it as is. I had created a macro to handle the basic import a space
delimited and then another macro to sort it the way i wanted. This
worked until the text file exceeded 65000 lines in excel. Now it has
become an issue. What i ultimately need to achieve is a way to define a
Start and Stop where all data between Start and Stop is read in as 1
line. It would identify CELL as the Start and read in to 1 line until
it comes across CELL (Stop) again. Then continues on. I just need the
CELL and CELLR data. Thus looking like so:

CELL CELLR
WA32300 WA31340 WA30780
WA30433 WA31960

......and so on down the file.

So, either some sort of Start and Stop trigger to define when to start
writing a new line into Excel or a means of sending a string to a
specific range (column) within Excel. So, any help or guidance you can
offer will be much appreciated.

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top