Parsing cells to reformat a multi-entry field database

L

Lurka

Hello,
I have a problem with a database imported from Lotus Notes. It
contains multi-entry fields, thus many cells have comma-separated
content, which counts as multiple records.

I need to create single records from each multi-entry field. Text-to-
column function is unsuitable, because I need to create new records
from each cell (not new columns). I was thinking about a script that:

1) parses the content of the selected cell until it finds a given
field separator (e.g. comma+space)
2) cuts the remainder of the cell
3) inserts a new row below the current one
4) copies the cut content in the corresponding cell of the new row
5) copies the other cells of the record in the new row
6) repeats process from step 1 on the same cell of the new row
7) continues with next row when it finishes parsing the cell for field
separators

Details like eliminating leftover comma+space from cells can be taken
care of manually afterwards.
Can you please suggest a VB Script to perform the operation?

Thank you very much,
/_urka
 
L

Lurka

Please provide samples of your input data and desired output.

An example of source records could be:

Alfa | Beta, Gamma, Delta | Epsilon
White | Red, Green | Blue, Yellow | Black

And the desired result is the 7 distinct records:

Alfa | Beta | Epsilon
Alfa | Gamma | Epsilon
Alfa | Delta | Epsilon
White | Red | Blue | Black
White | Green | Blue | Black
White | Red | Yellow | Black
White | Green | Yellow | Black

Thank you for your help,
/_urka
 
L

Lurka

all within a single cell?  Or is the pipe meant to indicate that, for
example

A1:     Alfa
B1:     Beta, Gamma, Delta
C1:     Epsilon

Yes, the pipe indicates separate cells as above, sorry for not being
clear enough.
I'll redirect the question to the group you suggested.

Thank you,
/_urka
 

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