[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Ftpapi] Empty line at the and of json







Verzonden vanaf mijn Samsung Galaxy-smartphone.



-------- Oorspronkelijk bericht --------
Van: federico.forsi@xxxxxxxxxxx
Datum: 16-09-2020 21:37 (GMT+01:00)
Aan: FTPAPI/HTTPAPI mailing list <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Onderwerp: Re: [Ftpapi] Empty line at the and of json

Thank you , I will try
Do you have an example to wite it in no pretty mode.?

Inviato da IBM Verse


Brad Stone --- Re: [Ftpapi] Empty line at the and of json ---

Da: "Brad Stone" <bvstone@xxxxxxxxx>
A: "FTPAPI/HTTPAPI mailing list" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Data: Mer, 16 Set 2020 21:21
Oggetto: Re: [Ftpapi] Empty line at the and of json


If it's how you posted, it's pretty mode.  So try turning it off.

On Wed, Sep 16, 2020 at 12:43 PM <federico.forsi@xxxxxxxxxxx> wrote:
I use default , i don't specify pretty or not.
If i open it with notepad i don't see the data formatted like json. I see all data without spaces and carriage return beetwen tags.
I think that the data aren't in a pretty mode..

Inviato da IBM Verse


Brad Stone --- Re: [Ftpapi] Empty line at the and of json ---

Da: "Brad Stone" <bvstone@xxxxxxxxx>
A: "FTPAPI/HTTPAPI mailing list" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Data: Mer, 16 Set 2020 18:43
Oggetto: Re: [Ftpapi] Empty line at the and of json


Have you tried turning off pretty json?

yajl_genOpen(*ON); // use *ON for easier to read JSON // *OFF for more compact JSON  

On Wed, Sep 16, 2020 at 11:17 AM <federico.forsi@xxxxxxxxxxx> wrote:
Hi, i create a JSON using  YAJL functions and i save it to ifs using yajl_saveBuf
After the last line of the json i have an empty line like follow.


                    "numeroordine": "820008953",
                    "codicesku": "ARIASANAMTABA",
                    "nomesku": "ARIASANA \"POWERTAB MICRO\"ANTIODORE.RIC.GR.300",
                    "quantita": "12.000",
                    "peso": "3.996",
                    "volume": "5.187",
                    "altezza": "9.500",
                    "larghezza": "19.500",
                    "lunghezza": "28.000",
                    "adr": ""
                }
            ]
        }
    ]
}
(empty line added after the end)
If i open the json whit notepad ++ i see this

The line 101147 is it empty  


The code that generate the json is :
 exsr JSON_Finish;      
 exsr JSON_Save;        

where the subrutines are :

  begsr JSON_Finish;                                  
                                                     
    yajl_endArray();                                
    yajl_endObj();                                  
                                                     
 endsr;                                              
                                                     
 begsr JSON_Save;                                    
                                                     
  yajl_saveBuf('/lac/ordini.txt':errmsg);            
  yajl_genClose();                                  
                                                     
                                                     
                                                     
 endsr;                                              



Is it possible to generate the json without the empy line? Where is the mistake in my code?

Thank you  very much!
Federico begsr JSON_Finish;                                  
                                                     
    yajl_endArray();                                
    yajl_endObj();                                  
                                                     
 endsr;                                              
                                                     
 begsr JSON_Save;                                    
                                                     
  yajl_saveBuf('/lac/ordini.txt':errmsg);            
  yajl_genClose();                                  
                                                     
                                                     
                                                     
 endsr;                                               begsr JSON_Finish;                                  
                                                     
    yajl_endArray();                                
    yajl_endObj();                                  
                                                     
 endsr;                                              
                                                     
 begsr JSON_Save;                                    
                                                     
  yajl_saveBuf('/lac/ordini.txt':errmsg);            
  yajl_genClose();                                  
                                                     
                                                     
                                                     
 endsr;                                              



I dati da lei conferiti sono trattati elettronicamente e manualmente dagli incaricati e comunicati a terzi per la gestione dell' attivita' economica e per l' invio di materiale pubblicitario; un eventuale rifiuto al trattamento non consente la sua corretta esecuzione. Ha diritto di accesso ai suoi dati ed altri diritti, come da art. 7 - D.Lgs.196/03.
L' informativa privacy, ai sensi e per gli effetti di cui all'art. 13 del D.lgs 196/03, e' consultabile all' indirizzo web
www.franzini.it/informativa.htm.

The informations provided will be processed manually and electronically by the data manager and will be disclosed to third parties for the management of economic and sending promotional materials; any refusal to treatment does not allow its proper implementation. You have access to these datas and other rights in accordance with art. 7 - D.Lgs.196/03. The privacy policy, in accordance with and for purposes of Art. 13 of Legislative Decree 196/03, is available at website
www.franzini.it/informativa.htm.

Le informazioni contenute nella presente comunicazione e i relativi allegati possono essere riservate e sono, comunque, destinate esclusivamente alle persone o alla Società sopraindicati. La diffusione, distribuzione e/o copiatura del documento trasmesso da parte di qualsiasi soggetto diverso dal destinatario è proibita, sia ai sensi dell’art. 616 c.p. , che ai sensi del D.Lgs. n. 196/2003. Se avete ricevuto questo messaggio per errore, vi preghiamo di distruggerlo e di informarci immediatamente per telefono allo 0522.929411 o inviando un messaggio all’indirizzo e-mail
mbox@xxxxxxxxxxx . Inoltre, il messaggio da Voi ricevuto è di natura non personale e le risposte al presente, potranno essere conosciute nell’organizzazione di appartenenza del mittente.

The information in this e-mail (which includes any files transmitted with it) is confidential and may also be legally privileged. It is intended for the addressee only. Access to this e-mail by anyone else is unauthorised. It is not to be relied upon by any person other than the addressee, except with our prior written approval. If no such approval is given, we will not accept any liability (in negligence or otherwise) arising from any third party acting, or refraining from acting on such information. Unauthorised recipients are required to maintain confidentiality. If you have received this e-mail in error please notify us immediately, destroy any copies and delete it from your computer system. Any use, dissemination, forwarding, printing or copying of this e-mail is prohibited. Copyright in this e-mail and any document created by us will be and remain vested in us and will not be transferred to you. We assert the right to be identified as the author of and to object to any misuses of the contents of this e-mail or such documents.
--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi

--
Questo messaggio è stato analizzato con Libraesva ESG ed è risultato non infetto.
Segnala come spam.
Mettilo in blacklist.
--
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi

--
Questo messaggio è stato analizzato con Libraesva ESG ed è risultato non infetto.
Segnala come spam.
Mettilo in blacklist.
-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi