473,513 Members | 3,777 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to compare value fields in different shapes

2 New Member
Good morning,

I have resume my old question for the follow:

I have shapes in different folders, and i need to check if the field "Codi_bd" and then i have to compare the value of the fields of this shapes with the value fields that should be, according to the oficial list of values that each shape should have.

I have already got the value fields for one shape in one folder, but now i need to do it for all the rest shapes in each folder automatically.

Thanks for any help!!!
Expand|Select|Wrap|Line Numbers
  1. #to check if field  "codi_BD" exists
  2. fcCampNE=[]
  3. f.write('\nChecking the shape escarpaments.shp :\n\n')
  4. for fc in fcExisteix:
  5. registres = []
  6. llista =[]
  7. fields = gp.ListFields(fc)
  8. #fields = gp.ListFields('escarpaments_7721.shp')
  9.  
  10. for field in fields:
  11.  
  12. if str(field.Name) == 'Codi_BD':
  13. cur = gp.SearchCursor (fc)
  14. row = cur.Next()
  15. nn = 0
  16. while row <> None:
  17. llista.append(row.Codi_BD)
  18. row = cur.Next()
  19.  
  20. for item in list:
  21. #Here we will create a new list eliminating duplicates
  22.  
  23. if item <>' ':
  24. if item not in registres:
  25. registres.append(item)
  26. for valor_camp in registres:
  27. treure = '_' + numfull + '.shp'
  28. llistaValor = fc.lstrip(treure)
  29. print llistaValor
  30. for valorFila in llistaValor:
  31. correcte = 0
  32. if str(valor_camp) == str(valorFila):
  33. correcte = 1
  34. if correcte == 0:
  35. # f.write(outFeatureClass+'-'+valor_camp + '......... existeix\n')
  36. #else:
  37. fcCampNE.append(valor_camp)
  38. nn = nn + 1
  39.  
  40.  
  41. for camp in fcCampNE:
  42. print camp
  43. f.write('\n'+ camp)
  44.  
  45. #f.write("\nHi ha " + str(nn) + " registres erronis.\n")
  46. f.write('\nComprobats tots els fitxers')
  47. f.close()
May 13 '10 #1
1 1543
Glenton
391 Recognized Expert Contributor
Hi

Please edit your post to include code tags. It's very hard to follow without the indentation.

Thanks
May 13 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
9991
by: CSATPRO | last post by:
I am trying query a table in access 2002xp.135,000 rows 65 fields per row. I need to compare two fields and return all rows where the values in the two fields do not match. field 1 is siteaddress field 2 is owneraddr1 I can get all the ones that match, its easy. In the siteaddress criteria box i put: = returns matches.
2
4090
by: Florian G. Pflug | last post by:
Hi Since sometime yesterday, my postgresql (7.4.5) reports "ERROR: cannot compare arrays of different element types", when I analyze a specific table in my database. Here is the tables definition: Column | Type | Modifiers...
3
6190
by: Simon | last post by:
Dear reader, For matching of two fields it is required that the fields has the same content. But now I have the situation that two text fields has not precisely the same content but there is some minute deference.
1
4180
by: amraam35 | last post by:
Here is the problem. I have made a log in script that prompts you to log in with a username and password as the "splash screen" It is an unbounded forum that checks that the username and password are in the employee table, and that they are together, and if it is, it lets you log on. That works just fine. Then i tried to make a form that you...
1
3457
by: Tbell | last post by:
Hello I admit I am somewhat of a beginner at this, but I am amazed as to why none of the examples and other help I have found have allowed me to get this working. I have two tables, table1 and table 2, with the following fields in them both Email, Date, ID now what I want to do, is compare the two tables and find the differences, so i can...
6
8125
by: Ledmark | last post by:
Hello - I am in a class for Access 2007 Database apllication design and we are covering types of Validation rules. We have a problem that I'm trying to solve but have no idea how to go about writing it. We are building a database for a condo rental company and the rental transaction table includes an arrival date and a departure date. We need...
3
3688
by: huda81 | last post by:
Dear all, I need help in creating this system really got tired by searching. I am new baby born programmer (^_^). The requirments are: Develop a Java applet that draws different shapes of different colours and different positions within the applet. Using combo-boxes the user should be able to specify the shape and colour; to specify...
3
3343
by: alter.fire | last post by:
Hey im trying to do the following in PHP: Connect to 2 different databases, one named complete and one incomplete. My goal is to find whats missing in the "incomplete" database. The fields i want to compare in the database/table is named 'name' in both. This field is comtaining unique names
3
5486
by: jim | last post by:
Each night, a scheduled task copies certain information from an MS Access db to a MySQL db that serves as a data warehouse. I would like to begin replicating multi-value fields from Access to MySQL, but when I try I run into the "unable to insert multi-value fields..." error. Does anyone know of a way around this? I would be satisfied with...
1
1362
by: flormarinkovic | last post by:
Good morning all, I am new in Python and i need your help. I have already wrote a program that works for one of the shapes that i need to check, but now i need to do the same for the rest of the shapes that i have in different folders. How could i do it? I really appreciate your help!
0
7270
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
5703
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5102
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4757
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3252
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3239
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.