<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help with writing python code to stop a script if an external table isn't complete in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096861#M62319</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you Joe!&amp;nbsp; After I posted that last reply regarding the bypass of the exit() I did go back to the link you sent me and there was an example with a sys.exit(0)&amp;nbsp; I put that in the script to replace exit() and it worked successfully!&amp;nbsp; Thank you so much for all your help!&amp;nbsp; You are a genius!&amp;nbsp; (see python window for full script that finally worked)&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#import arcpy module
import arcpy, os, sys
from arcpy import env
env.workspace = r"K:\GIS_UPDATE\DATA\EXTRACTVIEWS"
env.overwriteOutput = True

startTime = time.perf_counter()

# Opening a file
file = open(r"K:\AMANDA\Merlin226Data\MCPA226Data.csv","r")  # opens file read only
Counter = 0                 # sets the Counter variable to 0 (zero)
  
# Reading from file
Content = file.read()       # sets another variable called Content and reads
                            # everything from the read only file you just 
                            # opened
CoList = Content.split("\n") #sets yet another variable called CoList; when
                             #the file is open and read, it's all in one 
                             #line.  This splits each record at the new line
  
for i in CoList:
    if i:
        Counter += 1
# this for loop just plows through all the records and each time there is a 
# new record, the counter variable increases by one.  At the end of the for
# loop, Counter is equal to the number of records.

if Counter &amp;lt; 250000:
   sys.exit (0)

#MCPA226Data to Merlin226 Extract-----------------------------------------------------------------
arcpy.conversion.TableToTable(r"K:\AMANDA\Merlin226Data\MCPA226Data.csv", r"K:\GIS_UPDATE\DATA\EXTRACTVIEWS\EXTRACTVIEWS.gdb", "MCPA226DataTEST", '', r'PARCEL "PARCEL" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PARCEL,0,8000;ALT_KEY "ALT_KEY" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ALT_KEY,-1,-1;PC "PC" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PC,-1,-1;HX "HX" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,HX,0,8000;AG "AG" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,AG,0,8000;ADD_1 "ADD_1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_1,0,8000;ADD_2 "ADD_2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_2,0,8000;ADD_3 "ADD_3" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_3,0,8000;ADD_4 "ADD_4" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_4,0,8000;ADD_5 "ADD_5" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_5,0,8000;ZIP "ZIP" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZIP,0,8000;SITUS_1 "SITUS_1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SITUS_1,0,8000;SITUS_2 "SITUS_2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SITUS_2,0,8000;MILL_GRP "MILL_GRP" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MILL_GRP,-1,-1;NABRHD "NABRHD" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,NABRHD,-1,-1;BK1 "BK1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BK1,0,8000;PG1 "PG1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PG1,0,8000;MO1 "MO1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MO1,-1,-1;YR1 "YR1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,YR1,-1,-1;Q1 "Q1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,Q1,0,8000;VI1 "VI1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,VI1,0,8000;INST1 "INST1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,INST1,0,8000;PR_1 "PR_1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PR_1,-1,-1;MAP_NBR "MAP_NBR" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MAP_NBR,-1,-1;TWP "TWP" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TWP,-1,-1;RGE "RGE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RGE,-1,-1;SEC "SEC" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SEC,-1,-1;ACRES "ACRES" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ACRES,-1,-1;LND1 "LND1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LND1,0,8000;LND2 "LND2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LND2,0,8000;LND3 "LND3" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LND3,0,8000;ZONE1 "ZONE1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZONE1,0,8000;ZONE2 "ZONE2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZONE2,0,8000;ZONE3 "ZONE3" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZONE3,0,8000;BLDS "BLDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BLDS,-1,-1;WALL "WALL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,WALL,-1,-1;AGE "AGE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,AGE,-1,-1;COND "COND" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COND,-1,-1;ARCH "ARCH" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ARCH,0,8000;USE_SF "USE_SF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,USE_SF,-1,-1;YRBLT1 "YRBLT1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,YRBLT1,-1,-1;QUAL1 "QUAL1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,QUAL1,-1,-1;TYPE1 "TYPE1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TYPE1,0,8000;POOL "POOL" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,POOL,0,8000;STRY "STRY" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,STRY,0,8000;BLD1_SF "BLD1_SF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BLD1_SF,-1,-1;WELL "WELL" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,WELL,0,8000;SEPTIC "SEPTIC" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SEPTIC,0,8000;ASSD_VAL "ASSD_VAL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ASSD_VAL,-1,-1;TOT_VAL "TOT_VAL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_VAL,-1,-1;TOT_LND_VA "TOT_LND_VA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_LND_VA,-1,-1;TOT_BLD_VA "TOT_BLD_VA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_BLD_VA,-1,-1;TOT_MISC_V "TOT_MISC_V" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_MISC_V,-1,-1;TOT_TAX_VA "TOT_TAX_VA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_TAX_VA,-1,-1;TOT_TAXES "TOT_TAXES" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_TAXES,-1,-1;APP_DATE "APP_DATE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,APP_DATE,-1,-1;APP_ID "APP_ID" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,APP_ID,-1,-1;SOS "SOS" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SOS,0,8000;SU "SU" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SU,0,8000;HX_YR "HX_YR" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,HX_YR,-1,-1;STR "STR" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,STR,-1,-1;GRP "GRP" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,GRP,-1,-1;CITY "CITY" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,CITY,-1,-1;VM "VM" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,VM,-1,-1;CF "CF" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,CF,0,8000;CL_VAL "CL_VAL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,CL_VAL,-1,-1;N_CONS "N_CONS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,N_CONS,-1,-1;MKT_ADJ "MKT_ADJ" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MKT_ADJ,-1,-1;DATE_CREAT "DATE_CREAT" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,DATE_CREAT,-1,-1;DATE_L_UPD "DATE_L_UPD" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,DATE_L_UPD,-1,-1;B_UP "B_UP" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,B_UP,-1,-1;PPAR "PPAR" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PPAR,0,8000;RESUSESF "RESUSESF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RESUSESF,-1,-1;RESTOTSF "RESTOTSF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RESTOTSF,-1,-1;COMUSESF "COMUSESF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COMUSESF,-1,-1;COMTOTSF "COMTOTSF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COMTOTSF,-1,-1;RESBLDS "RESBLDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RESBLDS,-1,-1;COMBLDS "COMBLDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COMBLDS,-1,-1;LAVALUE "LAVALUE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LAVALUE,-1,-1;MRKT_AREA "MRKT_AREA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MRKT_AREA,-1,-1;BEDS "BEDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BEDS,-1,-1;BATHS "BATHS" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BATHS,-1,-1;GARAGE "GARAGE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,GARAGE,0,8000;FIRE "FIRE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,FIRE,0,8000;LOCOBS "LOCOBS" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LOCOBS,-1,-1;FUNCOBS "FUNCOBS" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,FUNCOBS,-1,-1;SEC_5 "SEC_5" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SEC_5,0,8000;LANDREV "LANDREV" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LANDREV,0,8000;NBRUNITS "NBRUNITS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,NBRUNITS,-1,-1;MH "MH" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MH,-1,-1;RTE "RTE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RTE,0,8000;HXUNDELIVERABLE "HXUNDELIVERABLE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,HXUNDELIVERABLE,0,8000;ROADTYPE "ROADTYPE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ROADTYPE,0,8000;SUBTYPE "SUBTYPE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SUBTYPE,0,8000;SINKHOLE "SINKHOLE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SINKHOLE,0,8000', '')

print("Merlin226Data to Merlin226DataTEST extract completed")

endTime = time.perf_counter()
elapsedTime = round((endTime - startTime) / 60, 2)
print("Script finished in {0} minutes".format(elapsedTime))
#input('Press ENTER to exit') &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Sep 2021 17:40:42 GMT</pubDate>
    <dc:creator>ABishop</dc:creator>
    <dc:date>2021-09-09T17:40:42Z</dc:date>
    <item>
      <title>Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096500#M62277</link>
      <description>&lt;P&gt;I am working in ArcGIS Pro 2.8.2.&amp;nbsp; I am not a professional programmer.&amp;nbsp; I have been writing python code for about a year and a majority of it comes from script I export and piece together using geoprocessing tools and models in ArcGIS Pro. I have written a series of scripts which run automatically at night to update our SDE and also dependent services which serve web maps/apps to the public.&amp;nbsp; The issue is that one of the data sources that assists with these updates is a .csv file created from a batch script that is ran from our CAMA system.&amp;nbsp; Sometimes this batch script doesn't work properly and the file doesn't have complete data which causes all of my scripts to generate files that aren't valid and then consequently, our web maps/apps fail the next day.&lt;/P&gt;&lt;P&gt;What can I add my python scripts to stop running if the source data is incomplete?&amp;nbsp; How would I go about doing this?&amp;nbsp; Any advice is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 18:23:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096500#M62277</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-08T18:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096518#M62279</link>
      <description>&lt;P&gt;What can you trap in the csv file to determine that the data is corrupt?&amp;nbsp; Do you always get all CAMA records and is it just that some fields are empty or would you only get a subset of expected records?&lt;/P&gt;&lt;P&gt;The easiest approach would be to define a number of expected records and if you do not get that then cancel your scripts.&amp;nbsp; The more difficult approach would be to read your data and look for Null fields where you would expect data and cancel your script if you find a Null value where a value is expected.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 19:31:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096518#M62279</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2021-09-08T19:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096521#M62280</link>
      <description>&lt;P&gt;What determines&amp;nbsp;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Sometimes this batch script doesn't work properly and the file doesn't have complete data&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;As&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10036"&gt;@MichaelVolz&lt;/a&gt;&amp;nbsp;suggests, if you can first check that file for completeness right at the beginning, you could exit before anything else is done.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 19:59:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096521#M62280</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-09-08T19:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096523#M62281</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10036"&gt;@MichaelVolz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for replying!&amp;nbsp; I would think the check of the .csv file from the batch process would be verifying a certain amount of records in the .csv and if it doesn't contain that amount of records, then the scripts that I have automated wouldn't run to extract the data which is used to create all the other features.&lt;/P&gt;&lt;P&gt;Do you have an example of code I could use?&amp;nbsp; Is there a certain tool or command I can use in my python code to do this?&lt;/P&gt;&lt;P&gt;Thank you both for any assistance you can offer.&lt;/P&gt;&lt;P&gt;Amanda&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 20:13:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096523#M62281</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-08T20:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096524#M62282</link>
      <description>&lt;P&gt;See if this helps you out:&amp;nbsp;&amp;nbsp;&lt;A href="https://www.geeksforgeeks.org/count-number-of-lines-in-a-text-file-in-python/" target="_blank"&gt;https://www.geeksforgeeks.org/count-number-of-lines-in-a-text-file-in-python/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 20:15:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096524#M62282</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-09-08T20:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096526#M62283</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the suggestion.&amp;nbsp; I assume that is only part of what I will need to do?&amp;nbsp; I am not a programmer.&amp;nbsp; I know a little bit of python code and the rest I rely on geoprocessing tool script and model builder.&amp;nbsp; I guess what I am looking for is a python code that will do the check of the .csv file then stop the extract data script from running if the .csv doesn't have x # of lines/records.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 20:22:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096526#M62283</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-08T20:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096528#M62284</link>
      <description>&lt;P&gt;Not exactly sure how you would set your record threshold, but you could either hard-code that into the python script or read it in from a config file that you can modify in a text editor.&lt;/P&gt;&lt;P&gt;If your Counter from script &amp;lt; threshold then instead of running code send an e-mail alerting you to bad data:&lt;/P&gt;&lt;P&gt;SUBJECT = "CAMA Data Update Alert "&lt;BR /&gt;TO = ["e-mail address"]&lt;BR /&gt;FROM = "server address"&lt;BR /&gt;text = "There was an error GIS data"&lt;BR /&gt;&lt;BR /&gt;BODY = string.join((&lt;BR /&gt;"From: %s" % FROM,&lt;BR /&gt;"To: %s" % TO,&lt;BR /&gt;"Subject: %s" % SUBJECT ,&lt;BR /&gt;"",&lt;BR /&gt;text&lt;BR /&gt;), "\r\n")&lt;BR /&gt;server = smtplib.SMTP('SMTP server URL',25) #server = smtplib.SMTP(HOST)&lt;BR /&gt;server.sendmail(FROM, TO, BODY)&lt;BR /&gt;server.quit()&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 20:24:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096528#M62284</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2021-09-08T20:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096530#M62285</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10036"&gt;@MichaelVolz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&amp;nbsp; I don't really want to rely on an email notification to alert me because then I have to manually stop the script on the server.&amp;nbsp; Is there a way to just code the check into the script itself and then if the data is bad, stop the script right before the data is extracted from the .csv?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 20:29:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096530#M62285</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-08T20:29:43Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096532#M62286</link>
      <description>&lt;P&gt;I don't have anything written off hand, but if I get a chance I'll see if I can scrape something together.&amp;nbsp; But that code in the sample is pretty straight forward.&amp;nbsp; Here is some translation for you:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;# Opening a file
file = open("gfg.txt","r")  # this opens gfg.txt for read only
Counter = 0                 # sets the Counter variable to 0 (zeror)
  
# Reading from file
Content = file.read()       # sets another variable called Contente and reads
                            # everything from the read only file you just 
                            #opened
CoList = Content.split("\n") #sets yet another variable called CoList; when
                             # the file is open and read, it's all in one 
                             #line.  This splits each record at the new line
  
for i in CoList:
    if i:
        Counter += 1
# this for loop just plows through all the records and each time there is a 
# new record, the counter variable increases by one.  At the end of the for
# loop, Counter is equal to the number of records.  You can check this value
# in an If/Then block against some value you set:

if Counter &amp;lt; 1000:
   exit

    
          &lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 08 Sep 2021 20:33:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096532#M62286</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-09-08T20:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096535#M62288</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp; Please stand by while I try to implement this.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 20:43:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096535#M62288</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-08T20:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096537#M62289</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following script and it did not work.&amp;nbsp; Please tell me what I'm doing wrong.&amp;nbsp; Does the .csv file have to be a .txt?&amp;nbsp; Does it have to be set in a variable instead of a file path?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#import arcpy module&lt;BR /&gt;import arcpy, os, sys&lt;BR /&gt;from arcpy import env&lt;BR /&gt;env.workspace = r"K:\GIS_UPDATE\DATA\EXTRACTVIEWS"&lt;BR /&gt;env.overwriteOutput = True&lt;/P&gt;&lt;P&gt;startTime = time.perf_counter()&lt;/P&gt;&lt;P&gt;# Opening a file&lt;BR /&gt;file = open("K:\AMANDA\Merlin226Data\MCPA226Data1.csv","r") # this opens txt file read only&lt;BR /&gt;Counter = 0 # sets the Counter variable to 0 (zero)&lt;BR /&gt;&lt;BR /&gt;# Reading from file&lt;BR /&gt;Content = file.read() # sets another variable called Contente and reads&lt;BR /&gt;# everything from the read only file you just&lt;BR /&gt;#opened&lt;BR /&gt;CoList = Content.split("\n") #sets yet another variable called CoList; when&lt;BR /&gt;# the file is open and read, it's all in one&lt;BR /&gt;#line. This splits each record at the new line&lt;BR /&gt;&lt;BR /&gt;for i in CoList:&lt;BR /&gt;if i:&lt;BR /&gt;Counter += 1&lt;BR /&gt;# this for loop just plows through all the records and each time there is a&lt;BR /&gt;# new record, the counter variable increases by one. At the end of the for&lt;BR /&gt;# loop, Counter is equal to the number of records.&lt;/P&gt;&lt;P&gt;if Counter &amp;lt; 250000:&lt;BR /&gt;exit&lt;/P&gt;&lt;P&gt;#MCPA226Data to Merlin226 Extract-----------------------------------------------------------------&lt;BR /&gt;arcpy.conversion.TableToTable(r"K:\AMANDA\Merlin226Data\MCPA226Data.csv", r"K:\GIS_UPDATE\DATA\EXTRACTVIEWS\EXTRACTVIEWS.gdb", "MCPA226DataTEST", '', r'PARCEL "PARCEL" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PARCEL,0,8000;ALT_KEY "ALT_KEY" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ALT_KEY,-1,-1;PC "PC" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PC,-1,-1;HX "HX" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,HX,0,8000;AG "AG" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,AG,0,8000;ADD_1 "ADD_1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_1,0,8000;ADD_2 "ADD_2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_2,0,8000;ADD_3 "ADD_3" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_3,0,8000;ADD_4 "ADD_4" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_4,0,8000;ADD_5 "ADD_5" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_5,0,8000;ZIP "ZIP" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZIP,0,8000;SITUS_1 "SITUS_1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SITUS_1,0,8000;SITUS_2 "SITUS_2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SITUS_2,0,8000;MILL_GRP "MILL_GRP" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MILL_GRP,-1,-1;NABRHD "NABRHD" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,NABRHD,-1,-1;BK1 "BK1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BK1,0,8000;PG1 "PG1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PG1,0,8000;MO1 "MO1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MO1,-1,-1;YR1 "YR1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,YR1,-1,-1;Q1 "Q1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,Q1,0,8000;VI1 "VI1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,VI1,0,8000;INST1 "INST1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,INST1,0,8000;PR_1 "PR_1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PR_1,-1,-1;MAP_NBR "MAP_NBR" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MAP_NBR,-1,-1;TWP "TWP" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TWP,-1,-1;RGE "RGE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RGE,-1,-1;SEC "SEC" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SEC,-1,-1;ACRES "ACRES" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ACRES,-1,-1;LND1 "LND1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LND1,0,8000;LND2 "LND2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LND2,0,8000;LND3 "LND3" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LND3,0,8000;ZONE1 "ZONE1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZONE1,0,8000;ZONE2 "ZONE2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZONE2,0,8000;ZONE3 "ZONE3" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZONE3,0,8000;BLDS "BLDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BLDS,-1,-1;WALL "WALL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,WALL,-1,-1;AGE "AGE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,AGE,-1,-1;COND "COND" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COND,-1,-1;ARCH "ARCH" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ARCH,0,8000;USE_SF "USE_SF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,USE_SF,-1,-1;YRBLT1 "YRBLT1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,YRBLT1,-1,-1;QUAL1 "QUAL1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,QUAL1,-1,-1;TYPE1 "TYPE1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TYPE1,0,8000;POOL "POOL" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,POOL,0,8000;STRY "STRY" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,STRY,0,8000;BLD1_SF "BLD1_SF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BLD1_SF,-1,-1;WELL "WELL" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,WELL,0,8000;SEPTIC "SEPTIC" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SEPTIC,0,8000;ASSD_VAL "ASSD_VAL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ASSD_VAL,-1,-1;TOT_VAL "TOT_VAL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_VAL,-1,-1;TOT_LND_VA "TOT_LND_VA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_LND_VA,-1,-1;TOT_BLD_VA "TOT_BLD_VA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_BLD_VA,-1,-1;TOT_MISC_V "TOT_MISC_V" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_MISC_V,-1,-1;TOT_TAX_VA "TOT_TAX_VA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_TAX_VA,-1,-1;TOT_TAXES "TOT_TAXES" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_TAXES,-1,-1;APP_DATE "APP_DATE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,APP_DATE,-1,-1;APP_ID "APP_ID" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,APP_ID,-1,-1;SOS "SOS" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SOS,0,8000;SU "SU" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SU,0,8000;HX_YR "HX_YR" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,HX_YR,-1,-1;STR "STR" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,STR,-1,-1;GRP "GRP" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,GRP,-1,-1;CITY "CITY" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,CITY,-1,-1;VM "VM" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,VM,-1,-1;CF "CF" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,CF,0,8000;CL_VAL "CL_VAL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,CL_VAL,-1,-1;N_CONS "N_CONS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,N_CONS,-1,-1;MKT_ADJ "MKT_ADJ" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MKT_ADJ,-1,-1;DATE_CREAT "DATE_CREAT" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,DATE_CREAT,-1,-1;DATE_L_UPD "DATE_L_UPD" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,DATE_L_UPD,-1,-1;B_UP "B_UP" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,B_UP,-1,-1;PPAR "PPAR" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PPAR,0,8000;RESUSESF "RESUSESF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RESUSESF,-1,-1;RESTOTSF "RESTOTSF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RESTOTSF,-1,-1;COMUSESF "COMUSESF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COMUSESF,-1,-1;COMTOTSF "COMTOTSF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COMTOTSF,-1,-1;RESBLDS "RESBLDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RESBLDS,-1,-1;COMBLDS "COMBLDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COMBLDS,-1,-1;LAVALUE "LAVALUE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LAVALUE,-1,-1;MRKT_AREA "MRKT_AREA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MRKT_AREA,-1,-1;BEDS "BEDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BEDS,-1,-1;BATHS "BATHS" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BATHS,-1,-1;GARAGE "GARAGE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,GARAGE,0,8000;FIRE "FIRE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,FIRE,0,8000;LOCOBS "LOCOBS" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LOCOBS,-1,-1;FUNCOBS "FUNCOBS" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,FUNCOBS,-1,-1;SEC_5 "SEC_5" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SEC_5,0,8000;LANDREV "LANDREV" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LANDREV,0,8000;NBRUNITS "NBRUNITS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,NBRUNITS,-1,-1;MH "MH" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MH,-1,-1;RTE "RTE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RTE,0,8000;HXUNDELIVERABLE "HXUNDELIVERABLE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,HXUNDELIVERABLE,0,8000;ROADTYPE "ROADTYPE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ROADTYPE,0,8000;SUBTYPE "SUBTYPE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SUBTYPE,0,8000;SINKHOLE "SINKHOLE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SINKHOLE,0,8000', '')&lt;/P&gt;&lt;P&gt;print("Merlin226Data to Merlin226DataTEST extract completed")&lt;/P&gt;&lt;P&gt;endTime = time.perf_counter()&lt;BR /&gt;elapsedTime = round((endTime - startTime) / 60, 2)&lt;BR /&gt;print("Script finished in {0} minutes".format(elapsedTime))&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 21:06:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096537#M62289</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-08T21:06:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096541#M62290</link>
      <description>&lt;LI-CODE lang="c"&gt;file = open("K:\AMANDA\Merlin226Data\MCPA226Data1.csv","r")
replace with:
file = open(r"K:\AMANDA\Merlin226Data\MCPA226Data1.csv","r")&lt;/LI-CODE&gt;&lt;P&gt;Use r to specify 'raw' text to the python interpreter.&amp;nbsp; Otherwise you have to escape those slashes in your path like this:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;file = open("K:\\AMANDA\\Merlin226Data\\MCPA226Data1.csv","r")&lt;/LI-CODE&gt;&lt;P&gt;I'm lazy and forgetful so when it comes to paths I always use r"C:\blah\blah\blah" so I don't have to remember which slash to use.&lt;/P&gt;&lt;P&gt;Also, you'll notice I'm using a code window to past my python into.&amp;nbsp; Expand the menu bar by clicking on the three dots; click on the &amp;lt;/&amp;gt; symbol and choose python from the drop down list.&amp;nbsp; Paste your code there.&amp;nbsp; It makes it much easier for us to read and/or trouble shoot...&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 21:13:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096541#M62290</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-09-08T21:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096544#M62291</link>
      <description>&lt;P&gt;I'd add this to the mix of suggestions. If its a possible issue with the second script starting before the CAMA export is complete, and you know the amount of time it generally takes for the CAMA export, you can set your second script to start a few minutes after the csv is complete. Then start by checking the last modified time of the csv file to see if its done or is still being constructed and abort if it is or continue to check for valid data in the csv. This might need some tweaking to work with how the export is creating the csv and if the modified time is updated while the file is being created. Might need to add/combine a created time check if modified isn't working.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import os
from datetime import datetime as dt

# Check the last modified date
yourCSV = os.path.getmtime(r'path to csv')
lstEdt = dt.fromtimestamp(yourCSV)
now = dt.now()
timeDelta = now - lstEdt

hours, remainder = divmod(timeDelta.seconds, 3600)
minutes, seconds = divmod(remainder, 60)

if minutes &amp;gt;= 15:
    # this means it has been over 15 minutes since last modified and you can assume its complete maybe
    print('CAMA Process is complete')
    # Check the CSV for completeness and abort if you find bad values
    with open(yourCSV) as csv_file:
        csv_reader = csv.reader(csv_file, delimiter='t')
            for row in csv_reader:
                if stuff is ok conditional:
                    do more stuff
                else:
                    print('Abort! CSV is corrupt')
else:
    # Nope
    print('CAMA process is not complete. Epically aborting or waiting for 5 min and trying again')&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 21:22:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096544#M62291</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-09-08T21:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096545#M62292</link>
      <description>&lt;P&gt;Amanda:&lt;/P&gt;&lt;P&gt;Do you have any communication with the admin of the original csv file?&amp;nbsp; I ask because how would you know the data errors would be fixed the next time to try to run the script.&amp;nbsp; Maybe it would be more proactive to trap the errors and let the csv admin personnel fix the data based on you errors you trapped in your code.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 21:22:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096545#M62292</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2021-09-08T21:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096686#M62299</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again.&amp;nbsp; I will attempt to implement this morning and update you as soon as I get a result.&amp;nbsp; Also, thanks for the tip on how to insert the python script in this message.&amp;nbsp; I will definitely use this for the future!&amp;nbsp; You are awesome!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 10:59:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096686#M62299</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-09T10:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096687#M62300</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10036"&gt;@MichaelVolz&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi.... I do have communication with the admin of the original .csv file. The issue is that the batch process she has running to create the .csv is coming from our CAMA database and she said it is very complicated to recreate or even troubleshoot.&amp;nbsp; I don't think she has much experience with it because she just took over as our IT Director.&amp;nbsp; Anyway, I am doing what I can to mitigate the issues because, as you can imagine, I have spent a log of time and effort creating all of my tasks to make this work and when her file doesn't get created properly, well... then it reflects poorly on me because none of my tasks work. SMH&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 11:02:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096687#M62300</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-09T11:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096689#M62301</link>
      <description>&lt;P&gt;@Anonymous User&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello Jeff,&lt;/P&gt;&lt;P&gt;Thank you for suggestion.&amp;nbsp; I will definitely consider it if my first option with Joe doesn't work.&amp;nbsp; This has been a 4 month project for me to get all of these tasks automated.&amp;nbsp; It certainly is disheartening to have one file that isn't create by me to mess it all up!&lt;/P&gt;&lt;P&gt;Amanda&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 11:04:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096689#M62301</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-09T11:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096708#M62302</link>
      <description>&lt;P&gt;Good plan.&amp;nbsp; There was a lot of conversation I didn't see while writing that post so its late to the party.&amp;nbsp; If you have any questions, feel free to ask.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 13:12:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096708#M62302</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-09-09T13:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096733#M62303</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to implement the script below this morning and it didn't exit, it continued to extract the table anyway.&amp;nbsp; Any more suggestions?&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#import arcpy module
import arcpy, os, sys
from arcpy import env
env.workspace = r"K:\GIS_UPDATE\DATA\EXTRACTVIEWS"
env.overwriteOutput = True

startTime = time.perf_counter()

# Opening a file
file = open(r"K:\AMANDA\Merlin226Data\MCPA226Data.csv","r")  # opens file read only
Counter = 0                 # sets the Counter variable to 0 (zero)
  
# Reading from file
Content = file.read()       # sets another variable called Content and reads
                            # everything from the read only file you just 
                            # opened
CoList = Content.split("\n") #sets yet another variable called CoList; when
                             #the file is open and read, it's all in one 
                             #line.  This splits each record at the new line
  
for i in CoList:
    if i:
        Counter += 1
# this for loop just plows through all the records and each time there is a 
# new record, the counter variable increases by one.  At the end of the for
# loop, Counter is equal to the number of records.

if Counter &amp;lt; 250000:
   exit

#MCPA226Data to Merlin226 Extract-----------------------------------------------------------------
arcpy.conversion.TableToTable(r"K:\AMANDA\Merlin226Data\MCPA226Data.csv", r"K:\GIS_UPDATE\DATA\EXTRACTVIEWS\EXTRACTVIEWS.gdb", "MCPA226DataTEST", '', r'PARCEL "PARCEL" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PARCEL,0,8000;ALT_KEY "ALT_KEY" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ALT_KEY,-1,-1;PC "PC" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PC,-1,-1;HX "HX" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,HX,0,8000;AG "AG" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,AG,0,8000;ADD_1 "ADD_1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_1,0,8000;ADD_2 "ADD_2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_2,0,8000;ADD_3 "ADD_3" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_3,0,8000;ADD_4 "ADD_4" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_4,0,8000;ADD_5 "ADD_5" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ADD_5,0,8000;ZIP "ZIP" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZIP,0,8000;SITUS_1 "SITUS_1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SITUS_1,0,8000;SITUS_2 "SITUS_2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SITUS_2,0,8000;MILL_GRP "MILL_GRP" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MILL_GRP,-1,-1;NABRHD "NABRHD" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,NABRHD,-1,-1;BK1 "BK1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BK1,0,8000;PG1 "PG1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PG1,0,8000;MO1 "MO1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MO1,-1,-1;YR1 "YR1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,YR1,-1,-1;Q1 "Q1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,Q1,0,8000;VI1 "VI1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,VI1,0,8000;INST1 "INST1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,INST1,0,8000;PR_1 "PR_1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PR_1,-1,-1;MAP_NBR "MAP_NBR" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MAP_NBR,-1,-1;TWP "TWP" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TWP,-1,-1;RGE "RGE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RGE,-1,-1;SEC "SEC" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SEC,-1,-1;ACRES "ACRES" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ACRES,-1,-1;LND1 "LND1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LND1,0,8000;LND2 "LND2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LND2,0,8000;LND3 "LND3" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LND3,0,8000;ZONE1 "ZONE1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZONE1,0,8000;ZONE2 "ZONE2" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZONE2,0,8000;ZONE3 "ZONE3" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ZONE3,0,8000;BLDS "BLDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BLDS,-1,-1;WALL "WALL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,WALL,-1,-1;AGE "AGE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,AGE,-1,-1;COND "COND" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COND,-1,-1;ARCH "ARCH" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ARCH,0,8000;USE_SF "USE_SF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,USE_SF,-1,-1;YRBLT1 "YRBLT1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,YRBLT1,-1,-1;QUAL1 "QUAL1" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,QUAL1,-1,-1;TYPE1 "TYPE1" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TYPE1,0,8000;POOL "POOL" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,POOL,0,8000;STRY "STRY" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,STRY,0,8000;BLD1_SF "BLD1_SF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BLD1_SF,-1,-1;WELL "WELL" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,WELL,0,8000;SEPTIC "SEPTIC" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SEPTIC,0,8000;ASSD_VAL "ASSD_VAL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ASSD_VAL,-1,-1;TOT_VAL "TOT_VAL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_VAL,-1,-1;TOT_LND_VA "TOT_LND_VA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_LND_VA,-1,-1;TOT_BLD_VA "TOT_BLD_VA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_BLD_VA,-1,-1;TOT_MISC_V "TOT_MISC_V" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_MISC_V,-1,-1;TOT_TAX_VA "TOT_TAX_VA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_TAX_VA,-1,-1;TOT_TAXES "TOT_TAXES" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,TOT_TAXES,-1,-1;APP_DATE "APP_DATE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,APP_DATE,-1,-1;APP_ID "APP_ID" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,APP_ID,-1,-1;SOS "SOS" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SOS,0,8000;SU "SU" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SU,0,8000;HX_YR "HX_YR" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,HX_YR,-1,-1;STR "STR" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,STR,-1,-1;GRP "GRP" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,GRP,-1,-1;CITY "CITY" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,CITY,-1,-1;VM "VM" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,VM,-1,-1;CF "CF" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,CF,0,8000;CL_VAL "CL_VAL" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,CL_VAL,-1,-1;N_CONS "N_CONS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,N_CONS,-1,-1;MKT_ADJ "MKT_ADJ" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MKT_ADJ,-1,-1;DATE_CREAT "DATE_CREAT" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,DATE_CREAT,-1,-1;DATE_L_UPD "DATE_L_UPD" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,DATE_L_UPD,-1,-1;B_UP "B_UP" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,B_UP,-1,-1;PPAR "PPAR" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,PPAR,0,8000;RESUSESF "RESUSESF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RESUSESF,-1,-1;RESTOTSF "RESTOTSF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RESTOTSF,-1,-1;COMUSESF "COMUSESF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COMUSESF,-1,-1;COMTOTSF "COMTOTSF" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COMTOTSF,-1,-1;RESBLDS "RESBLDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RESBLDS,-1,-1;COMBLDS "COMBLDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,COMBLDS,-1,-1;LAVALUE "LAVALUE" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LAVALUE,-1,-1;MRKT_AREA "MRKT_AREA" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MRKT_AREA,-1,-1;BEDS "BEDS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BEDS,-1,-1;BATHS "BATHS" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,BATHS,-1,-1;GARAGE "GARAGE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,GARAGE,0,8000;FIRE "FIRE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,FIRE,0,8000;LOCOBS "LOCOBS" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LOCOBS,-1,-1;FUNCOBS "FUNCOBS" true true false 8 Double 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,FUNCOBS,-1,-1;SEC_5 "SEC_5" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SEC_5,0,8000;LANDREV "LANDREV" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,LANDREV,0,8000;NBRUNITS "NBRUNITS" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,NBRUNITS,-1,-1;MH "MH" true true false 4 Long 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,MH,-1,-1;RTE "RTE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,RTE,0,8000;HXUNDELIVERABLE "HXUNDELIVERABLE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,HXUNDELIVERABLE,0,8000;ROADTYPE "ROADTYPE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,ROADTYPE,0,8000;SUBTYPE "SUBTYPE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SUBTYPE,0,8000;SINKHOLE "SINKHOLE" true true false 8000 Text 0 0,First,#,K:\AMANDA\Merlin226Data\MCPA226Data.csv,SINKHOLE,0,8000', '')

print("Merlin226Data to Merlin226DataTEST extract completed")

endTime = time.perf_counter()
elapsedTime = round((endTime - startTime) / 60, 2)
print("Script finished in {0} minutes".format(elapsedTime))
#input('Press ENTER to exit') &lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 09 Sep 2021 13:50:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096733#M62303</guid>
      <dc:creator>ABishop</dc:creator>
      <dc:date>2021-09-09T13:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: Help with writing python code to stop a script if an external table isn't complete</title>
      <link>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096805#M62309</link>
      <description>&lt;P&gt;Is there a chance that the counter is never getting to 250000?&amp;nbsp; Why not set it at a much lower value and print out what the counter is at right before the program exits as it might be doing something unexpected at this point?&amp;nbsp; This would only be needed for trouble-shooting purposes.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Sep 2021 15:50:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-writing-python-code-to-stop-a-script-if/m-p/1096805#M62309</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2021-09-09T15:50:07Z</dc:date>
    </item>
  </channel>
</rss>

