The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 10-14-2008
regnumber regnumber is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 9
Thank you for your reply Johnson.

Here the problem is how to read PCN, ACCNO, TRANCD, AMOUNT, LOB_TIMESTAMP from a text file. The data will be as follows in the text file.

Quote:

9564587 111222333 AD 563.85 2008-10-01-00.00.00.000000
9564588 111222334 AE 567.85 2008-10-02-00.00.00.000000
9564589 111222335 AF 963.85 2008-10-03-00.00.00.000000
9564590 111222336 AH 566.85 2008-10-04-00.00.00.000000
The data existing in a text file is a raw data. The length of each field is fixed length.
Is it possible to do like as follows.
pcn is 7 byte starting from 1 to 7
accno is 9 byte starting from 9 to 17
tran_cd is 2 byte starting from 19 to 20
amount is 8 byte starting from 22 to 29
LOB_TIMESTAMP is 26 byte starting from 30 to 55

can we define like this and will pass data. If so how to define in shell script ?

Could you please let me know how to proceed furthur.

Krishnakanth