From: Manuel C. <mco...@gm...> - 2021-06-07 08:53:50
|
Resent. The previous attempt to respond failed. El 04/06/2021 a las 12:25, Vinícius dos Santos Oliveira escribió: > Hi, > > I've been playing with GAWK extension API again and I'm wondering what's > the proper way to report errors on individual records. > > If there was a problem to extract a single record on the stream, how > should I report this to the user? The relevant sections of the gawk manual are: 17.4.6 Printing Messages 17.4.7 Updating ERRNO > > I only know two GAWK extensions that play with input modes. XML where > failing the whole stream is fine, and CSV where I just don't see errors > on single records. Therefore I don't know where to look for current > practice. The gawk-csv extension reports syntax errors on a per-record basis. It can even give several error messages for the same input record. $ echo 'a"b" ,"c,"x' | gawk -lcsv -v CSVMODE=1 '{1}' gawk: error: csvinput: Unexpected quote a" ^ gawk: error: csvinput: Unexpected quote a"b" ^ gawk: error: csvinput: Unexpected character a"b" ,"c,"x ^ Regards. -- Manuel Collado - http://mcollado.z15.es |