2013-01-11 Sancho Lerena <alerena@artica.es>
* util/pandora_csvbridge.pl: Fixed code for CSV bridge too git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7475 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
2329b16cd4
commit
69a409d973
|
@ -1,3 +1,7 @@
|
|||
2013-01-11 Sancho Lerena <alerena@artica.es>
|
||||
|
||||
* util/pandora_csvbridge.pl: Fixed code for CSV bridge too
|
||||
|
||||
2013-01-11 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* lib/PandoraFMS/Config.pm
|
||||
|
|
|
@ -42,7 +42,7 @@ sub print_usage () {
|
|||
print "\t-hV Help (this help)\n";
|
||||
print "\nSample Usage:\n\n";
|
||||
print "\tperl pandora_csv_bridge.pl -f datos4.csv -c @ -A 2 -Y 26 -M Consumo_Electrico -d /tmp/dump -G 3 -X 12\n\n";
|
||||
exit;
|
||||
exit;
|
||||
}
|
||||
|
||||
sub transform_date ($){
|
||||
|
@ -80,6 +80,10 @@ $opt_T = "generic_data";
|
|||
my $utimestamp;
|
||||
my $utimestamp_extra;
|
||||
|
||||
if ( $ARGV[0] eq "" ) {
|
||||
print_usage();
|
||||
}
|
||||
|
||||
GetOptions
|
||||
("h" => \$opt_h,
|
||||
"R" => \$opt_R,
|
||||
|
@ -142,13 +146,18 @@ for ($ax = 0; $ax < $opt_s; $ax++){
|
|||
|
||||
# Dump header
|
||||
if ( defined($opt_R)){
|
||||
my @header_data = split ("$opt_c", $header );
|
||||
|
||||
if (!defined($opt_c)){
|
||||
print_usage();
|
||||
}
|
||||
|
||||
my %header_data = split ("$opt_c", $header );
|
||||
my $key;
|
||||
|
||||
print "\nDumping CSV Structure (Field Label -> Field Order)\n\n";
|
||||
|
||||
foreach $key (keys @header_data){
|
||||
print $header_data[$key] ." -> ". $key ." \n";
|
||||
foreach $key (keys %header_data){
|
||||
print $header_data{$key} ." -> ". $key ." \n";
|
||||
}
|
||||
|
||||
exit;
|
||||
|
|
Loading…
Reference in New Issue