[grisbi-bugs] [Grisbi 0001890]: export data champ "Date" embedded in quotes with a LF before ending quote

Grisbi Bug Tracker bugtracker at grisbi.org
Lun 14 Jan 15:06:55 CET 2019


The following issue has been SUBMITTED. 
====================================================================== 
http://www.grisbi.org/bugsreports/view.php?id=1890 
====================================================================== 
Reported By:                travesp
Assigned To:                
====================================================================== 
Project:                    Grisbi
Issue ID:                   1890
Category:                   Main
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
OS:                         SuSE 
Unstable Impact:            Yes 
Version OS:                 Leap 15.0  KDE 
Version GTK:                 
====================================================================== 
Date Submitted:             2019-01-14 15:06 CET
Last Modified:              2019-01-14 15:06 CET
====================================================================== 
Summary:                    export data  champ "Date" embedded in quotes with a
LF before ending quote
Description: 
Cher Pierre, Je me permets de signaler un caractère de trop dans EXPORT : champ
DATE commence par QUOTE, après le date jj/mm/aaaa, >>> après  0x0a (LF) <<<,
après QUOTE.
J'espère que ma petite contribution (entre >>> ... <<<) vous servira de rendre
GRISBI encore plus stable.
J'ai pu me débrouiller grâce à awk pour joindre chaque 2 lignes: 
if (NR == 1) {
print "Date","Chq", "Montant", "Notes", "Exerc", "Tiers", "Categ", "Budg"
next}
if ($1 == 0) next  # transaction number zero : initial balance

# bug in Grisbi : date field ends with a linefeed char (before ending quotes).
# so we need to join every 2nd line, the 1st line of a pair contains 4 fields
if(NF==4) { getline flw; $0=$0 flw}  
gsub(/"/,"",$6)  # remove quotes from data field

print substr($4,2,10), $6, $10-$11, $17, $7, $9, $13, $15   # $10 - $11 : 
crédit MINUS débit = montant

Pierre, merci pour tout le beau travail ! Theo

Steps to Reproduce: 
Il suffit d'EXPORTer
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2019-01-14 15:06 travesp        New Issue                                    
======================================================================



Plus d'informations sur la liste de diffusion bugsreports