Skip to content

Instantly share code, notes, and snippets.

@HiromichiYamada
Created June 26, 2013 09:18
Show Gist options
  • Save HiromichiYamada/5866008 to your computer and use it in GitHub Desktop.
Save HiromichiYamada/5866008 to your computer and use it in GitHub Desktop.
テキストを読み込んで1行ずつ書きだすPerlスクリプト。 文字列置換処理などを入れる前のベース。
#!/usr/bin/perl
use strict;
my $tgtFilename = "textToExport.txt";
my $orgFilename = "textToImport.txt";
open(ORG_TEXT, "<$orgFilename") or die("error :$!");
open(TGT_TEXT, ">$tgtFilename") or die("error :$!");
while (my $line = <ORG_TEXT>){
# copy.
print TGT_TEXT $line;
}
close(TGT_TEXT);
close(ORG_TEXT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment