Skip to content

Commit

Permalink
squash newlines in xml, change column heading to bionotate_xml
Browse files Browse the repository at this point in the history
  • Loading branch information
tomclegg committed Jul 8, 2012
1 parent db92b38 commit 557aebb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions export_bionotate.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#!/usr/bin/php
<?php
;
<?php ; // -*- mode: java; c-basic-indent: 4; tab-width: 4; indent-tabs-mode: nil; -*-

chdir ('public_html');
require_once 'lib/setup.php';
Expand All @@ -18,14 +17,15 @@
");
if (theDb()->isError($q)) die ($q->getMessage() . "\n");

$fields = split(' ', 'edit_timestamp edit_oid variant_id variant_gene variant_aa_del variant_aa_pos variant_aa_ins variant_rsid summary_long');
$fields = split(' ', 'edit_timestamp edit_oid variant_id variant_gene variant_aa_del variant_aa_pos variant_aa_ins variant_rsid bionotate_xml');
fputcsv($fh, $fields);

$n=0;
while ($row =& $q->fetchRow()) {
$out = array();
$row['bionotate_xml'] = preg_replace('{\n}', '', $row['summary_long']);
foreach ($fields as $f) {
$out[] = $row[$f];
$out[] = $row[$f];
}
fputcsv($fh, $out);
}
Expand Down

0 comments on commit 557aebb

Please sign in to comment.