Select to view content in your preferred language

Splitting data in an attribute table

5910
14
Jump to solution
12-08-2020 06:23 AM
SimonCrutchley
Occasional Contributor III

Is it possible to split data within a single field in an attribute table. I have been provided some data where one field currently consists of concatenated data from a table with multiple values separated by "/". There are numerous duplicate elements, which makes the field look messy, so I'd like to remove them. I've had success doing this by exporting into Excel and Word, but it's very long winded, and because of the size of the files very slow, so I wondered if it's possible actually working within GIS.

0 Kudos
14 Replies
SimonCrutchley
Occasional Contributor III

Brilliant! I hadn't realised it sorts alphabetically, which confused me at first, but that's fine. The key fact is that it removes all the annoying duplicates.

Apologies that I misunderstood about all the different bits in the code and which need to be added and which don't.

Thanks so much. 😊

0 Kudos
SimonCrutchley
Occasional Contributor III

Hi Dan,

You were very helpful with the above last year, so I'm hoping that you can help again with a similar issue. Having concatenated the list so that it is searchable in a single attribute, I now discover that I need to make hyperlinks to the various entries 🤔. The easiest way to do this seems to be to split them into separate entries and then do a link to each unique entry, as there are far too many different combinations. I assume that this is what the first part of your program did, so hope it's not difficult to then create a new field for each of the separate options e.g. the field TYPE 'ENCLOSURE/FIELD/FIELD SYSTEM/SETTLEMENT' becomes TYPE1 'ENCLOSURE', TYPE2 'FIELD', TYPE3 'FIELD SYSTEM' etc.

I hope you can help.

Cheers

0 Kudos
DanPatterson
MVP Esteemed Contributor

@SimonCrutchley are you requiring that you use the same idea, but place each parsed value into a separate field?

Maybe you could elaborate more on what the table and inputs should look like.


... sort of retired...
0 Kudos
SimonCrutchley
Occasional Contributor III

Hi Dan,

That's exactly it. As I show above, I currently have the concatenated fields, separated by / e.g. the field currently called 'TYPE' has entries such as 'ENCLOSURE/FIELD/FIELD SYSTEM/SETTLEMENT' and I would like this to become a number of separate new fields TYPE1 = 'ENCLOSURE', TYPE2 = 'FIELD', TYPE3 = 'FIELD SYSTEM' etc

I attach a sample of a file where I did the split manually, to see if the process would produce the data in a form that I could then use in Portal, in a pop-up.

I hope that makes sense.

Thanks

0 Kudos
SimonCrutchley
Occasional Contributor III

Hi Dan,

I was just wondering whether you'd had any further thoughts about this? Do you need further information from me?

Thanks

0 Kudos