-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Ryuichiro Nakato
committed
Mar 5, 2024
1 parent
a4226c0
commit f31e34e
Showing
5 changed files
with
58 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/usr/bin/env perl | ||
|
||
use strict; | ||
use warnings; | ||
use Path::Class; | ||
use Excel::Writer::XLSX; | ||
use Getopt::Long qw/:config posix_default no_ignore_case bundling auto_help/; | ||
|
||
my @input = (); | ||
my $output = ""; | ||
my $delim = "\t"; | ||
my @name = (); | ||
GetOptions('input|i=s' => \@input, 'output|o=s' => \$output, 'delim|d=s' => \$delim, 'name|n=s' => \@name); | ||
|
||
if($#input ==-1 || $output eq ""){ | ||
print " csv2xlsx.pl: merge csv file(s) to xlsx.\n\n"; | ||
print " Usage: csv2xlsx.pl -i <input.csv> [-i <input.csv> ...] -o output.xlsx\n\n"; | ||
print " Options:\n\t-d --delim = <str>: delimiter of csv (default:\\t)\n\n"; | ||
exit; | ||
} | ||
|
||
my $workbook = Excel::Writer::XLSX->new($output); | ||
|
||
my %hash; | ||
for(my $i=0; $i<=$#input; $i++) { | ||
my $tabname; | ||
if($#name ==-1) { | ||
my $tabname_full=(split /\//,$input[$i])[-1]; | ||
$tabname = substr($tabname_full, 0, 27); | ||
while(exists($hash{$tabname})) { | ||
$tabname = $tabname . "2"; | ||
} | ||
$hash{$tabname}=1; | ||
}else { | ||
$tabname = $name[$i]; | ||
} | ||
my $worksheet = $workbook->add_worksheet($tabname); | ||
|
||
my $file = file($input[$i]); | ||
my $fh = $file->open('r') or die "Error: $input[$i] does not exist.\n"; | ||
my $nrow=0; | ||
while(<$fh>){ | ||
chomp; | ||
my @clm = split(/$delim/, $_); | ||
for(my $j=0; $j<=$#clm; $j++) { $worksheet->write( $nrow, $j, $clm[$j]);} | ||
$nrow++; | ||
} | ||
$fh->close; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
tag=0.12.1 | ||
tag=0.12.2 | ||
docker build -f Dockerfile.$tag -t rnakato/churros:$tag . #--no-cache | ||
#docker save -o churros-$tag.tar rnakato/churros:$tag | ||
#singularity build -F /work3/SingularityImages/churros.$tag.sif docker-archive://churros-$tag.tar | ||
|
||
#exit | ||
docker push rnakato/churros:$tag | ||
docker tag rnakato/churros:$tag rnakato/churros:latest | ||
docker push rnakato/churros |