Hello, I'm trying to to combine two examples in this forum without success - sorry for the newbie question... This involves using the US Census site to repetitively look up census block data for addresses in a CSV file, one per row.
Data in address.csv (two columns, three row example, the number is an ID and not relevant):
"3335 NE WEDGEWOOD DR","109007986"
"895 NE EMERSON DR","109007987"
"1503 NE WALDORF CIR","109007995"
The script is:
VERSION BUILD=6801021
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=http://factfinder.census.gov/servlet/AGSGeoAddressServlet?_MapEvent=&_category=&_subcategory=&_stateSelectedFromDropDown=Florida&context=ags&programYear=50%3A420&street=3335+NE+WEDGEWOOD+DR&city=palm+bay&states=Florida&zip=&geo_id=10000US120850013027006&_programYear=50&_treeId=420&_lang=en&tree_id=420&bucket_id=
CMDLINE !DATASOURCE ADDRESSES.csv
SET !DATASOURCE_COLUMNS 2
SET !LOOP 1
SET !DATASOURCE_LINE {{!LOOP}}
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:form1 ATTR=ID:tx_address CONTENT={{!COL1}}
TAG POS=1 TYPE=IMG ATTR=ALT:Go
'New page loaded
TAG POS=1 TYPE=SELECT FORM=NAME:form1 ATTR=NAME:_geo_id EXTRACT=TXT CONTENT=5
SAVEAS TYPE=EXTRACT FOLDER=* FILE=mytable_{{!NOW:yymmdd_hhmmss}}.csv
The odd URL is because I want to load a semi-filled in form (no need that way to repeat filling in the city and state name - all I need to fill in is the address line (tx_address). The script works fine (well, fine enough for me) until the last line, which bombs with error -308. My difficulty is in selecting the 5th row of the output list box (_geo_id, according to the EXTRACT WIZARD), and writing it to a file (appending, actually). I'd even be happy getting the whole list box and doing some post-processing.
Two problems: Without the CONTENT=5 (the row number of the block data in the list box), nothing gets written out to the file(s). With CONTENT=5, the script dies. Second, a new file is created for each LOOP, and it would be nice to just have records appended to the same file.
My apologies in advance if I've missed something in the forum - any help gratefully accepted... Thanks!
Yes, I know LOOP is set to 1 (the first data file had headers, simpler just to set this to 1 and leave the statement in to remind me what to do for other input files, and yes, the URL is a bit clunky (I just used a saves query so the servlet won't choke).