Home » SQL & PL/SQL » SQL & PL/SQL » Masking fixed length flat file
icon6.gif  Masking fixed length flat file [message #256794] Mon, 06 August 2007 13:14 Go to next message
kham2k
Messages: 34
Registered: May 2007
Member
Hello,
I have a typical requirement.
I have a flat file which is a fixed length one.
In this flat file from 3rd position to 21st position (i.e 19 characters) is allocated for the acc #. The acc # may not be of full length. The length can vary from 10-19 characters. the data fields are fixed. if the account number doesn't fill all the 19 positions then you will have blanks.
Hope this clarify my problem in more detail


Now my requirement is that I need to replace this acc # in such a way that leaving the first 6 digits and last 4 digits the remaining digits should be 0.

Eg.
xx123456789108738 xxxxx
xx8399456789911117386xxxx
xx5734567893333333 xxxx

output
xx123456000008738 xxxxx
xx8399450000000007386xxxxx
xx5734560000003333 xxxxx


Thanks to all for help
Re: Masking fixed length flat file [message #256797 is a reply to message #256794] Mon, 06 August 2007 13:26 Go to previous message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Does not substr function fit your requirement?

Regards
Michel
Previous Topic: MAIL
Next Topic: Insert into table
Goto Forum:
  


Current Time: Sun Dec 11 04:10:15 CST 2016

Total time taken to generate the page: 0.13994 seconds