草花木果 (ダイニングバー / 中目黒、代官山、祐天寺)
★★★★☆ 4.0
ティーヌン ラゾーナ川崎プラザ店 (タイ料理 / 川崎、京急川崎)
★★★★☆ 4.0
.hoge{
float: left;
magin-left: 10px;
}
.hoge{
float: left;
padding-left: 10px;
}
.hoge{
float: left;
display: inline;
magin-left: 10px;
}
system("cp ./a.csv ./b.csv");
use File::Copy;
copy("./a.csv","./b.csv") or die "error: $!";
use File::Copy;
copy("./a.csv","/var/www/html/bk");
ビストロ ラ・クッチーナ (イタリアン / 渋谷、神泉、代々木公園)
★★★★☆ 4.0
# 引数にアスタリスク( * )を指定すると、. で始まらないすべてのファイル一覧を取得
my @file = glob "*";
print join( "\t", @file ), "\n";
"* .*" . で始まるファイルも対象にする場合は引数に"* .*"を指定
my @file2 = glob "* .*";
print join( "\t", @file2 ), "\n";
my @file = glob "*.txt *.pl";
print join( "\t", @file ), "\n";
chdir("/var/www/html");
my @file = glob "*.html";
print join( "\t", @file ), "\n";
# ディレクトリオープン
opendir(DIRHANDLE, "./");
# ディレクトリエントリの取得
foreach(readdir(DIRHANDLE)){
next if /^\.{1,2}$/; # '.'や'..'をスキップ
print "$_\n";
}
# ディレクトリクローズ
closedir(DIRHANDLE);
perl -MCPAN -e shell
install Text::CSV_XS
#!/usr/bin/perl -w
use strict;
use Text::CSV_XS;
my $csv = Text::CSV_XS->new ({ binary => 1 });
open my $fh, "<", "t.csv";
open my $fh_out, ">", "t.txt";
while (my $columns = $csv->getline ($fh)) {
print $fh_out map({ "[$_]\t" } @$columns), "\n";
}
$csv->eof;
close $fh_out;
close $fh;
Text::CSV_XS->new({binary=>1});
#!/usr/bin/perl -w
use strict;
use Text::CSV_XS;
use IO::File;
use Fcntl qw(:flock);
# データに日本語が含まれる場合は{binary=>1}オプションを忘れずに
my $csv = Text::CSV_XS->new({binary=>1});
my $io = IO::File->new('./t.csv', "r");
my $io_out = IO::File->new('./t.txt', "w");
flock($io_out, LOCK_EX);
while (not $io->eof and my $columns = $csv->getline($io)) {
$io_out->print(map({ "[$_]\t" } @$columns), "\n");
}
flock($io_out, LOCK_UN);
$io->close;
$io_out->close;
$columns = $csv->getline($io)
$columns = $csv->getline($io)
print $$columns[0];
# フィールド名の用意
my @f_name= qw/ id date category title text /;
while (not $io->eof and my $columns = $csv->getline($io)) {
my %field;
for ( my $i=0; $i<=$#f_name; $i++ ){
$field{$f_name[$i]} = $$columns[$i];
}
# titleフィールドのみ出力
print $field{'title'},"\n";
}
チャノマ (カフェ / 中目黒、代官山、恵比寿)
★★★☆☆ 3.5