Re: unload and hpl behavior
Posted in 2009
The quoted blank is to distinguish it from an empty field which would indicate a NULL value is to be inserted into the column. Since VARCHAR and LVARCHAR columns strip out trailing spaces, the single space is quoted so that the space is loaded as a hard space and not as a zero length string. The embedded newlines are more difficult. Sed cannot, IB, handle them at all since it only deals with lines of data. You will have to use awk or perl if you must use a scripting language or write a parser in 'C'. IB the embedded newlines in the unload file format are quoted with a backslash much as the spaces you noted. In awk it would be something like awk ' BEGIN { str=""; } { line = $0; len = length( line ); if ( substr( line, len, 1 ) == "\\") { str = str, line; next; } else { str = line; } print str; str = ""; }' <input.unl >output.unl Not tested. Art Art S. Kagel Oninit (www.oninit.com) IIUG Board of Directors (art@iiug.org) Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on my employer, Oninit, the IIUG, nor any other organization with which I am associated either explicitly or implicitly. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Tue, Nov 3, 2009 at 4:53 PM, Floyd Wellershaus <floyd@fwellers.com>wrote: > I'm pretty sure the answer to this is no, but thought I'd double check. > We are using IDS10.0.FC5. > When we unload with either unload or hp loader, varchar columns that have a > blank space in them show up with a backslash. For eg... a 2 column table > firstname lastname may unload like this. > |floyd|\\ | > > I think this has to do with the db_locale and this behavior can't be > changed. But am I correct ? > > Also, one other thing. There are some newlines within our data that we > would like to parse out with sed, but of course not get rid of the newlines > at the true end of a record. > Does anyone know the sed syntax that may accomplish that ? > > Thank you, > Floyd > > > _______________________________________________ > Informix-list mailing list > Informix-list@iiug.org > http://www.iiug.org/mailman/listinfo/informix-list > >