2013년 2월 17일 일요일

파일 각 라인 왼쪽 문자 제거

#!/usr/bin/perl

#Specify the file
$file = "key.txt";
#Open the file and read data
#Die with grace if it fails
open (FILE, "<$file") or die "Can't open $file: $!\n";
@lines = ;
open (DATA, '>>data.txt');
foreach ( @lines ) {
print $_;
#$_ =~ s/^d{3}//;
$_=substr($_,4);
print DATA $_;
}
#Finish up
close FILE;
close DATA;

댓글 없음:

댓글 쓰기