Skip to main content
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

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!

 

 

 

 


jdh
Contributor
Forum|alt.badge.img+28
  • Contributor
  • March 1, 2018

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

 

 

textlinebreaks.fmw

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings