AnsweredAssumed Answered

Splitting String at ',' accounting for No Data

Question asked by deleted-user-qpvAI3Fo0MKR on Jan 10, 2019
Latest reply on Jan 11, 2019 by deleted-user-qpvAI3Fo0MKR

I've got a table with a field named Maintenance Tasks. I would like to parse the values in this field into separate fields (Task1, Task2 etc.):

 

 

I can use:

         None if !MaintenanceTasks! == None else !MaintenanceTasks!.split(',')[0]

and this will parse the first item correctly into Task1, it also accounts for any null values in MaintenanceTasks.

 

The problem I'm running into is, for example, OID 23 above, when there's just a single item in the MaintenanceTasks field (ReplaceHead).

 

Any help would be greatly appreciated. FWIW I'll be scripting in Python.

Outcomes