Page 1 of 1

Appending zeros using UFF

PostPosted: Tue Jun 03, 2014 2:51 pm
by itstg
Hello gurus,

I have a file which is VB and is of the following format

1|201403|18092000010|1|Y|3132.68|16|0|1|1|1|0|1|1|1|1|1|1|0           
1|201403|94954110083|0|N|0.00|0|0|1|0|1|0|0|0|0|0|0|0|0               
1|201403|8358210009|0|N|0.00|0|0|1|0|1|1|1|0|1|0|0|0|0               
1|201403|211312005|1|N|340.00|18|0|0|0|0|0|0|0|0|1|0|0|0             
1|201403|8986802|1|N|1733.33|46|0|0|0|0|0|0|1|0|1|0|0|0           


The desired output would be
1|201403|18092000010|1|Y|3132.68|16|0|1|1|1|0|1|1|1|1|1|1|0           
1|201403|94954110083|0|N|0.00|0|0|1|0|1|0|0|0|0|0|0|0|0               
1|201403|08358210009|0|N|0.00|0|0|1|0|1|1|1|0|1|0|0|0|0               
1|201403|00211312005|1|N|340.00|18|0|0|0|0|0|0|0|0|1|0|0|0             
1|201403|00008986802|1|N|1733.33|46|0|0|0|0|0|0|1|0|1|0|0|0           


What is essentially required is to append trailing zeros to the colum starting at position 10 (till the point of the next double pipes).Can this be achived using UFF in SORT. Any help on this would be great.

Thanks in advance,
IT STG

Re: Appending zeros using UFF

PostPosted: Tue Jun 03, 2014 3:13 pm
by BillyBoyo
Those are leading zeros, not trailing zeros.

You will need to use PARSE, to extract that number, and to extract the remaining part of the record. Field type FS when putting the data back together, or an EDIT. You will need to use VLTRIM on OUTFIL to drop the blanks created by the second PARSEd field.