eventdb/scripts/csv2rem.pl

36 lines
810 B
Perl
Raw Permalink Normal View History

2014-09-05 22:22:02 +02:00
#!/usr/bin/env perl
#===============================================================================
#
# FILE: csv2rem.pl
#
# USAGE: ./csv2rem.pl
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: Ralph J.Mayer (rm),
# ORGANIZATION:
# VERSION: 1.0
# CREATED: 05.09.2014 22:21:15
# REVISION: ---
#===============================================================================
2014-08-25 20:01:43 +02:00
use strict;
use warnings;
2014-09-05 22:22:02 +02:00
use utf8;
2014-08-25 20:01:43 +02:00
my $file = $ARGV[0] or die "Need to get CSV file on the command line\n";
open(my $data, '<', $file) or die "Could not open '$file' $!\n";
while (my $line = <$data>) {
chomp $line;
my @fields = split ";" , $line;
print "REM $fields[2]-$fields[1]-$fields[0] +10 $fields[6] $fields[10] %b\n";
}