# HG changeset patch # User Calvin Yeh # Date 1506613393 -7200 # Node ID 0ef426b5a1b996039e1730cf12833a1382a4a931 # Parent 507070df62e635bd85ab88d3bef121e411f98a0c replace delimit character from "tab" to "comma" diff -r 507070df62e6 -r 0ef426b5a1b9 views/Extractapp/ExportTabDelimited.php --- a/views/Extractapp/ExportTabDelimited.php Thu Sep 28 17:13:39 2017 +0200 +++ b/views/Extractapp/ExportTabDelimited.php Thu Sep 28 17:43:13 2017 +0200 @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License * along with Extraction-interface. If not, see . */ -/*! \file +/*! \file * This is the view for ExportTabDelimited. */ @@ -32,65 +32,68 @@ $count=1; foreach ( $outputTableArray as $trIndex =>$trValue ) { - - if ( $trIndex==0 ) { - echo "#\t"; - echo "Book ID\t"; - echo "Section ID\t"; - echo "Name\t"; - echo "部\t"; - echo "Address\t"; - echo "Longitude\t"; // longitude - echo "Latitude\t"; // latitude - echo "Description\t"; // description + + if ( $trIndex==0 ) { + echo ","; + echo "Book ID,"; + echo "Section ID,"; + echo "Book Name,"; + echo "Section Name,"; + echo "Book Year,"; + echo "Edition Year,"; + echo "Addres,"; + echo "Longitude,"; // longitude + echo "Latitude,"; // latitude + echo "Description,"; // description } else { - echo $count++."\t"; - echo $bookId."\t"; - echo $sectionid."\t"; - echo $bookName."\t"; - echo $sectionName."\t"; - echo $bookMeta->place_name."\t"; - echo $bookMeta->x."\t"; - echo $bookMeta->y."\t"; - echo $bookName."_".$sectionName."\t"; // description for LGMap - + echo $count++.","; + echo $bookId.","; + echo $sectionid.","; + echo $bookName.","; + echo $sectionName.","; + echo $bookMeta->book_year.","; + echo $bookMeta->edition_year.","; + echo $bookMeta->place_name.","; + echo $bookMeta->x.","; + echo $bookMeta->y.","; + echo $bookName."_".$sectionName.","; // description for LGMap + } if ( isset( $trValue["page"] ) ) { - echo $trValue["page"]."\t"; + echo $trValue["page"].","; } else { - echo "\t"; + echo ","; } - - foreach ( $outputTableArray[0][0] as $index => $value ) { + + foreach ( $outputTableArray[0][0] as $index => $value ) { if ( $index == "time" ) { if ( isset( $trValue[0][$index] ) ) { - echo $trValue[0][$index]."\t"; - echo $trValue[0][$index]."\t"; + echo $trValue[0][$index].","; + echo $trValue[0][$index].","; } else { - echo "\t"; - echo "\t"; + echo ","; + echo ","; } } else { if ( isset( $trValue[0][$index] ) ) { - echo $trValue[0][$index]."\t"; + echo $trValue[0][$index].","; } else { - echo "\t"; + echo ","; } } } if ( isset( $trValue["other"] ) ) { - echo $trValue["other"]."\t"; + echo $trValue["other"].","; } else { - echo "\t"; + echo ","; } if ( isset( $trValue["full"] ) ) { - echo $trValue["full"]."\t"; + echo $trValue["full"].","; } else { - echo "\t"; + echo ","; } echo "\n"; } ?> -