AnsweredAssumed Answered

Script to contatenate the same field from several records

Question asked by jsn on Sep 26, 2014
Latest reply on Sep 30, 2014 by curtvprice

Hi all,

 

I am looking for a script, preferably a Python script that reads all the records from a file and concatenates them in a result variable.

 

I am using ArcMap to "Select By Attributes" and I would like to have a way to format a list of IDs I am importing form a text file, or Ms Excell list. To build a Definition Query in the Query Builder window.

 

 

Input: (from xxx.txt)

 

341440

341444

341521

341534

341580

341664

341783

 

Output: (to zzz.txt)

 

ID=’341440’ OR ID= ‘341444’ OR ID= ‘341521’ OR ID= ‘341534’ OR ID= ‘341580’ OR ID= ‘341664’ OR ID= ‘341783’

 

 

Thanks

Outcomes