Skip to content

Instantly share code, notes, and snippets.

@yunnysunny
Created September 22, 2018 10:15
Show Gist options
  • Save yunnysunny/37494ee50944f0686985b592665cbfbf to your computer and use it in GitHub Desktop.
Save yunnysunny/37494ee50944f0686985b592665cbfbf to your computer and use it in GitHub Desktop.
perl遍历文件
my $originalList = 'tt.log';
open LIST_SRC,"$originalList";
while (<LIST_SRC>) {
chomp;
my $line = $_;
# print $line."\n";
if ($line =~ /timestamp=(\d+)/) {
my $time = $1;
print "$time,\n";
} else {
}
}
close LIST_SRC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment