Created
September 22, 2018 10:15
-
-
Save yunnysunny/37494ee50944f0686985b592665cbfbf to your computer and use it in GitHub Desktop.
perl遍历文件
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
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