Question

Connect lines without common ID by order in file


Hi

I have a csv file with lines that relate to each other purely by the order they appear in the file. So all the records with a record type "1" are the main record and the lines below with 2, 3, 4 or 5 record types relate the record above with the type 1. There could be any number of lines below and you only know when you get to a new record because you get a new record type 1. I would like to assign a new field with a common ID to the lines that refer to the same property. So in the first example the 8 lines would have a common ID and then the next 3 lines a different ID.

1 106 London road

2 Ground

2 Ground

2 First

1 104 London Road

2 Stores

3 Offices

1 Retail

4 Car Parking

Any help gratefully received.

Thanks

Ruth


2 replies

Sorry my example didn't follow what I said. I posted an image but this disappeared. Basically I want to connect the first 4 lines together. The next 3 and the finally 2. Thanks!

 

 

 

 

Badge +22

You can use the adjacent features to assign an id, that increments when you get to a record 1.

 

 

textlinebreaks.fmw

Reply