Advertisement
cd62131

Reassemble data

Apr 15th, 2017
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.51 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use utf8;
  5. use open qw|:std :encoding(utf8)|;
  6. use feature 'say';
  7.  
  8. my $process = {};
  9. my $skip_header = <>;
  10. while (<>) {
  11.   chomp;
  12.   my @line = split /\s*,\s*/;
  13.   $process->{$line[2]} = {} unless defined($process->{$line[2]});
  14.   $process->{$line[2]}->{$line[1]} = $line[0];
  15. }
  16.  
  17. say join ',', ('処理名', '開始日時', '終了日時');
  18. for my $ps (sort keys %$process) {
  19.   say join ',', ($ps, $process->{$ps}->{開始}, $process->{$ps}->{終了});
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement