Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The U.S. Federal Election Commission (FEC) makes detailed campaign finance infor

ID: 3772991 • Letter: T

Question

The U.S. Federal Election Commission (FEC) makes detailed campaign finance information public at 40 1 http://www.fec.gov/finance/disclosure/ftpdet.shtml

Use the ftp UNIX command to obtain a candidate master file named cn16.zip from the ftp.fec.gov server. This file is located in the /FEC/2016 directory on the server. Use the unzip command to extract the text file named cn.txt from the cn16.zip archive. This is a plain text file that contains information on all House, Senate, and presidential candidates that ran in various federal elections. Each line contains one candidate’s record that consists of 15 fields separated by the vertical bar symbol (|). The format of this file is described in detail at http://www.fec.gov/finance/disclosure/metadata/DataDictionaryCandidateMaster.shtml

Look at the file using an editor to familiarize yourself with record structure and typical field data. Among other things, note the three-letter party abbreviations in the third field, and the type of office the candidate is running for, in the sixth field.

Write a Perl script that prints full names and ZIP codes of all independent candidates running in California House districts (in any year). After the list, print the total count of candidates on the list. Show the script and the result of its execution.

Explanation / Answer

House = state of race

President = US

Seante = state of race

H = House

P = President

S = Seante

Congressional district number.

Congressional At Large 00

Senate 00

Presidential 00

Mailing Address - Street

Mailing Address - Street2

Mailing Address - City

Mailing Address - State

Mailing Address - Zip Code

Column Name Field Name Position Null? Data Type Description CAND_ID Candidate Identification 1 N VARCHAR2(9) A 9-character alpha-numeric code assigned to a candidate by the Federal Election Commission. The candidate ID for a specific candidate remains the same across election cycles as long as the candidate is running for the same office. CAND_NAME Candidate Name 2 Y VVARCHAR2(200) CAND_PTY_AFFILIATION Party Affiliation 3 Y VARCHAR2(3) The political party affiliation reported by the candidate. CAND_ELECTION_YR Year of Election 4 Y Number(4) Candidate's election year from a Statement of Candidacy or state ballot list. CAND_OFFICE_ST Candidate State 5 Y VARCHAR2(2)

House = state of race

President = US

Seante = state of race

CAND_OFFICE Candidate Office 6 Y VARCHAR2(1)

H = House

P = President

S = Seante

CAND_OFFICE_DISTRICT Candidate District 7 Y VARCHAR2(2)

Congressional district number.

Congressional At Large 00

Senate 00

Presidential 00

CAND_ICI Incumbent Challenger Status 8 Y VARCHAR2(1) C = Challenger
I = Incumbent
O = Open Seat is used to indicate an open seat. Open seats are defined as seats where the incumbent never sought re-election. CAND_STATUS Candidate Status 9 Y VARCHAR2(1) C = Statutory candidate
F = Statutory candidate for future election
N = Not yet a statutory candidate
P = Statutory candidate in prior cycle CAND_PCC Principal Campaign Committee 10 Y VARCHAR2(9) The ID assigned by the Federal Election Commission to the candidate's principal campaign committee for a given election cycle. CAND_ST1 Mailing Address - Street 11 Y VARCHAR2(34)

Mailing Address - Street

CAND_ST2 Mailing Address - Street2 12 Y VARCHAR2(34)

Mailing Address - Street2

CAND_CITY Mailing Address - City 13 Y VARCHAR2(30)

Mailing Address - City

CAND_ST Mailing Address - State 14 Y VARCHAR2(2)

Mailing Address - State

CAND_ZIP Mailing Address - Zip Code 15 Y VARCHAR2(9)

Mailing Address - Zip Code

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote