diff --git a/bin/dump_cand b/bin/dump_cand index fb803273fa..8052c913b9 100755 --- a/bin/dump_cand +++ b/bin/dump_cand @@ -7,7 +7,7 @@ use 5.010; use lib 'lib'; use TwittElection::Schema; -my $file = shift || 'db/candidate.csv'; +my $file = shift || 'db/candidate.tsv'; my $sch = TwittElection::Schema->connect( "dbi:mysql:database=$ENV{TE_DB}", $ENV{TE_USER}, $ENV{TE_PASS}, diff --git a/bin/load_cand b/bin/load_cand index 0ebdf282e6..c45f73e4a9 100755 --- a/bin/load_cand +++ b/bin/load_cand @@ -7,7 +7,7 @@ use 5.010; use lib 'lib'; use TwittElection::Schema; -my $file = shift || 'db/candidate.csv'; +my $file = shift || 'db/candidate.tsv'; my $sch = TwittElection::Schema->connect( "dbi:mysql:database=$ENV{TE_DB}", $ENV{TE_USER}, $ENV{TE_PASS}, @@ -25,7 +25,7 @@ $sch->resultset('Candidate')->delete; while (<$fh>) { chomp; - my ($name, $twitter, $party, $constituency) = split /\|/; + my ($name, $twitter, $party, $constituency) = split /\t/; my $con = $con_rs->find({ name => $constituency, diff --git a/db/candidate.csv b/db/candidate.csv deleted file mode 100644 index d084040cbe..0000000000 --- a/db/candidate.csv +++ /dev/null @@ -1,14 +0,0 @@ -Jane Ellison|janeellisonmp|Conservative|Battersea -Dan Watkins|DanWatkins|Conservative|Tooting -Nadine Dorries|NadineDorriesMP|Conservative|Mid Bedfordshire -Will Martindale|WillJMartindale|Labour|Battersea -Sadiq Khan|SadiqKhan|Labour|Tooting -Charlynne Pullen|CharlynnePullen|Labour|Mid Bedfordshire -Douglas Carswell|DouglasCarswell|Conservative|Clacton -Stephen Kinnock|SKinnock|Labour|Aberavon -Guto Bebb|GutoBebb|Conservative|Aberconwy -Frank Doran||Labour|Aberdeen North -Anne Begg|annebegg|Labour|Aberdeen South -Pamela Nash|pamela_nash|Labour|Airdrie and Shotts -Gerald Howarth|geraldhowarth|Conservative|Aldershot -Richard Shepherd||Conservative|Aldridge-Brownhills \ No newline at end of file diff --git a/db/candidate.tsv b/db/candidate.tsv new file mode 100644 index 0000000000..45797c246a --- /dev/null +++ b/db/candidate.tsv @@ -0,0 +1,26 @@ +Jane Ellison janeellisonmp Conservative Battersea +Dan Watkins DanWatkins Conservative Tooting +Nadine Dorries NadineDorriesMP Conservative Mid Bedfordshire +Will Martindale WillJMartindale Labour Battersea +Sadiq Khan SadiqKhan Labour Tooting +Charlynne Pullen CharlynnePullen Labour Mid Bedfordshire +Douglas Carswell DouglasCarswell Conservative Clacton +Stephen Kinnock SKinnock Labour Aberavon +Guto Bebb GutoBebb Conservative Aberconwy +Frank Doran Labour Aberdeen North +Anne Begg annebegg Labour Aberdeen South +Pamela Nash pamela_nash Labour Airdrie and Shotts +Gerald Howarth geraldhowarth Conservative Aldershot +Richard Shepherd Conservative Aldridge-Brownhills +Graham Brady grahambradymp Conservative Altrincham and Sale West +Mark Tami MarkTamiMP Labour Alyn and Deeside +Nigel Mills NigelMillsMP Conservative Amber Valley +Mike Weir mikeweirsnp SNP Angus +Hywel Williams HywelWilliamsMP Plaid Cymru Arfon +Alan Reid Liberal Democrat Argyll and Bute +Nick Herbert nickherbertmp Conservative Arundel and South Downs +Gloria De Piero GloriaDePieroMP Labour Ashfield +Damian Green Conservative Ashford +David Heyes davidheyesmp Labour Ashton-under-Lyne +David Lidington DLidington Conservative Aylesbury +Sandra Osborne Labour Ayr, Carrick and Cumnock \ No newline at end of file diff --git a/lib/TwittElection/Schema/Result/Candidate.pm b/lib/TwittElection/Schema/Result/Candidate.pm index 2d603fbee8..519bcacf8e 100644 --- a/lib/TwittElection/Schema/Result/Candidate.pm +++ b/lib/TwittElection/Schema/Result/Candidate.pm @@ -148,7 +148,7 @@ __PACKAGE__->belongs_to( sub dump { my $self = shift; - my $delim = $_[0] || '|'; + my $delim = $_[0] || "\t"; return join $delim, $self->name, $self->twitter, $self->party->name, $self->constituency->name;