syafid

Looping thru feature class using for loop statement

Discussion created by syafid on Jun 20, 2011
Latest reply on Jun 21, 2011 by syafid
Hi there
I am writing a py code to check and identify identical value in 2 different fc.

example :
       Feature_A                      Feature_B
FID     submission_no         FID         submission_no
  0   ES20100408-12345      0         ES20110615-09876
  1   ES20110615-09876      1         ES20100408-12345


Here are my code:

import arcpy
from arcpy import env

fc_input = "D:\gdb-prd\GDB-PRD.gdb\TESTING\Feature_A
fc_output = "D:\gdb-prd\GDB-PRD.gdb\TESTING\Feature_B"

rowFC_input = arcpy.SearchCursor(fc_input)
rowFC_output = arcpy.SearchCursor(fc_output)

for i in rowFC_input:
    print "input >"
    print i.submission_no
    for x in rowFC_output:
        print "output >"
        print x.submission_no


#arcpy.AddMessage(Message)
print 'Python print command...All Done'

Here are the output:

>>>
input >
ES20100408-12345
output >
ES20110615-09876
output >
ES20100408-12345
input >
ES20110615-09876
Python print command...All Done
>>>

How to make the output like this :

input >
ES20100408-12345
output >
ES20110615-09876
output >
ES20100408-12345
input >
ES20110615-09876
output >
ES20110615-09876
output >
ES20100408-12345


How can i loop in feature_B twice?

Need Help

Thanks.
Syafid

Outcomes