creating QIF file under Dos using AWK

piggyb piggybattery at gmail.com
Wed Mar 18 06:23:50 EDT 2015


With the help of Google I have created this Perl script #!/usr/bin/perl  use
strict;  use warnings;  use Text::CSV; my $file = "input.csv";  open my $fh,
"<", $file or die "$file: $!";  my $csv = Text::CSV->new ({ binary => 1,
auto_diag => 1,sep_char => ";" });  $csv->column_names ($csv->getline
($fh)); # use header      print "!Type:Bank\n";    while (my $row =
$csv->getline_hr ($fh)) {            my $CreditDebet = $row->{CreditDebet};            
print "D".$row->{TransactionDate}."\n";       	      if ( $CreditDebet eq
"C"){	      		print "T".$row->{Amount}."\n"; 	      		    	      }	     
elsif ( $CreditDebet eq "D"){	      		print "T-".$row->{Amount}."\n"; 	      		    	     
} 	        print "M".$row->{Disciption}."\n"   	print
"N".$row->{PayMethode}."\n";				   	print "P".$row->{CounterNumber}."\n";   
print "A".$row->{Adress}."\n";   	print "^\n";   	      }  close $fh; But
how can I tell the script that the second row contains the headers? The
first row starts with BANK EXPORT;;;;;;;;;;;;;;



--
View this message in context: http://gnucash.1415818.n4.nabble.com/creating-QIF-file-under-Dos-using-AWK-tp4676673p4676996.html
Sent from the GnuCash - User mailing list archive at Nabble.com.


More information about the gnucash-user mailing list