|
sed "s/^,/0,/" or sed "s/^,/' ',/" would cover the nulls in the first position. There's also a way to combine the two so that you don't have to parse the file twice. -Jim -----Original Message----- From: Tim Truax [mailto:truax@telerama.com] Sent: Wednesday, January 22, 2003 9:53 PM To: Midrange Systems Technical Discussion Subject: Re: cpyfrmimpf null dilemma ? Jim, This may work, but there are many records that begin with 1 comma. So the replacement of the dual-commas would miss the single comma occurring at the beginning of many of these records. Thanks! ----- Original Message ----- From: "Jim Damato" <jdamato@dollargeneral.com> To: "'Midrange Systems Technical Discussion'" <midrange-l@midrange.com> Sent: Wednesday, January 22, 2003 5:47 PM Subject: RE: cpyfrmimpf null dilemma ? > On Unix could you run a vi or awk command to fill in the nulls by scanning > for groups of two commas. According to our Unix Sys Admin the command: > > sed "s/,,/,0,/g" < inputfile > outputfile > > would create a new file with the nulls replaced with zeros. If you needed > blanks you could use the same sed command above substituting 0 with ' ' > > -Jim > > James P. Damato > Manager - Technical Administration > Dollar General Corporation > <mailto:jdamato@dollargeneral.com> > > > -----Original Message----- > From: Martin Rowe [mailto:martin@dbg400.net] > Sent: Wednesday, January 22, 2003 4:16 PM > To: Midrange Systems Technical Discussion > Subject: RE: cpyfrmimpf null dilemma ? > > > On Wednesday 22 January 2003 10:01 pm, Draper, Dale wrote: > > I think DBG400(freeware) has a utility for this. > > http://www.dbg400.net/ > > Actually I've only got tools for going the other way - an alternative to > CPYTOIMPF. I do have a csv parser routine that takes in a line and passes > out an array with the individual fields, stripped of the quoting > character (whatever it is) and an indication of which fields those were. > It's on my to-do list to bundle this up into a proper tool, but it hasn't > happened yet. Would the parser be of any use? > > Regards, Martin > > > -----Original Message----- > > From: Tim Truax [mailto:truax@telerama.com] > > Sent: Wednesday, January 22, 2003 1:56 PM > > To: ML - Midrange Email List > > Subject: cpyfrmimpf null dilemma ? > > > > > > Hey all, > > Trying to copy a very attractive and massive file that I got from a > > UNIX box to my AS400. > > However this "very attractive" file has the dreaded "nulls" disease. > > Them voids between the commas are killing this! > > > > Meaning > > ,,data,,data,,0,1 > > ,data,,data,2,,3 > > > > What shall I do to get this file to happily travel the "cpyfrmimpf" > > route to my matching AS400 database file ?? > > Now the "cpyfrmimpf" is griping about the "nulls" ...any suggestions > > from you smart individuals is greatly appreciated ??? > > > > Tim :-) > -- > martin@dbg400.net AIM/Gaim: DBG400dotNet http://www.dbg400.net /"\ > DBG/400 - DataBase Generation utilities - AS/400 / iSeries Open \ / > Source free test environment tools and others (file/spool/misc) X > Debian GNU/Linux | ASCII Ribbon Campaign against HTML mail & news / \ > _______________________________________________
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.