Advertisement
pilgon-sesh60

compounds.pl

Oct 22nd, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.39 KB | None | 0 0
  1. open($input_file, "<" . $ARGV[0]);
  2. open($output_file, ">" . $ARGV[1]);
  3.  
  4. while (my $row = <$input_file>) {
  5.   chomp $row;
  6.   if($row =~ m/([\x3400-\x4DB5\x4E00-\x9FCB\xF900-\xFA6A\w]+),([\x3041-\x3096]+),([\w'():, ]+)/gmu) {
  7.       print $output_file "$1\t$2 ($3)\n";
  8.       print $output_file "$3 ($1)\t$2\n";
  9.       print $output_file "$2\t$3 ($1)\n";
  10.  }
  11. }
  12. close($input_file);
  13. close ($output_file);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement