Need help on sort
Posted: Sat Oct 20, 2012 9:50 pm
Hi can someone help me out?
Please find below my requirement
Input file is VB
Record-1(starting 5 bytes contain AAAAA)
row in which key present, starting 5 bytes contain KKKKK(K denoting Key), and key(3 BYTES) can start from 10 position
row in which value has to be pick,starting 5 bytes contain VVVVV(V denoting value) value for 30th postion to 7 bytes
-------(some other un wanted row)
--------------------------------------------------------------------------------------
Record-2(starting 5 bytes contain AAAAA)
-------(some other un wanted row)
row in which key present, starting 5 bytes contain KKKKK(K denoting Key), and key(3 BYTES) can start from 10 position
-------(some other un wanted row)
row in which value has to be pick,starting 5 bytes contain VVVVV(V denoting value) value for 30th postion to 7 bytes
-------(some other un wanted row)
------------------------------------------------------------------------------------
Record-3(starting 5 bytes contain AAAAA)
-------(some other un wanted row)
row in which key present, starting 5 bytes contain KKKKK(K denoting Key), and key(3 BYTES) can start from 10 position
-------(some other un wanted row)
row in which value has to be pick,starting 5 bytes contain VVVVV(V denoting value) value for 30th postion to 7 bytes
-------(some other un wanted row)
------------------------------------------------------------------------------------
Record-4(starting 5 bytes contain AAAAA)
-------(some other un wanted row)
-------(some other un wanted row)
row in which key present, starting 5 bytes contain KKKKK(K denoting Key), and key(3 BYTES) can start from 10 position
row in which value has to be pick,starting 5 bytes contain VVVVV(V denoting value) value for 30th postion to 7 bytes
-------(some other un wanted row)
if there is NO key present in that record, then ignore that record
Required output is
AAAAA KEY VALUE-1
AAAAA KEY VALUE-2
AAAAA KEY VALUE-3
AAAAA KEY VALUE-4
Please find below my requirement
Input file is VB
Record-1(starting 5 bytes contain AAAAA)
row in which key present, starting 5 bytes contain KKKKK(K denoting Key), and key(3 BYTES) can start from 10 position
row in which value has to be pick,starting 5 bytes contain VVVVV(V denoting value) value for 30th postion to 7 bytes
-------(some other un wanted row)
--------------------------------------------------------------------------------------
Record-2(starting 5 bytes contain AAAAA)
-------(some other un wanted row)
row in which key present, starting 5 bytes contain KKKKK(K denoting Key), and key(3 BYTES) can start from 10 position
-------(some other un wanted row)
row in which value has to be pick,starting 5 bytes contain VVVVV(V denoting value) value for 30th postion to 7 bytes
-------(some other un wanted row)
------------------------------------------------------------------------------------
Record-3(starting 5 bytes contain AAAAA)
-------(some other un wanted row)
row in which key present, starting 5 bytes contain KKKKK(K denoting Key), and key(3 BYTES) can start from 10 position
-------(some other un wanted row)
row in which value has to be pick,starting 5 bytes contain VVVVV(V denoting value) value for 30th postion to 7 bytes
-------(some other un wanted row)
------------------------------------------------------------------------------------
Record-4(starting 5 bytes contain AAAAA)
-------(some other un wanted row)
-------(some other un wanted row)
row in which key present, starting 5 bytes contain KKKKK(K denoting Key), and key(3 BYTES) can start from 10 position
row in which value has to be pick,starting 5 bytes contain VVVVV(V denoting value) value for 30th postion to 7 bytes
-------(some other un wanted row)
---------------------------------------------------------------
AAAAA
KKKKK KEY
VVVVV VALUE-1
EEEEE
------------------------------------------------------------------
AAAAA
HHHHH
KKKKK KEY
PPPPP
VVVVV VALUE-2
SSSSS
-----------------------------------------------------------------
AAAAA
SSSSS
KKKKK KEY
SSSSS
VVVVV VALUE-3
-----------------------------------------------------------------
AAAAA
PPPPP
00000
KKKKK KEY
VVVVV VALUE-4
SSSSS
--------------------------------------------------------------------
AAAAA
KKKKK KEY
VVVVV VALUE-1
EEEEE
------------------------------------------------------------------
AAAAA
HHHHH
KKKKK KEY
PPPPP
VVVVV VALUE-2
SSSSS
-----------------------------------------------------------------
AAAAA
SSSSS
KKKKK KEY
SSSSS
VVVVV VALUE-3
-----------------------------------------------------------------
AAAAA
PPPPP
00000
KKKKK KEY
VVVVV VALUE-4
SSSSS
--------------------------------------------------------------------
if there is NO key present in that record, then ignore that record
Required output is
AAAAA KEY VALUE-1
AAAAA KEY VALUE-2
AAAAA KEY VALUE-3
AAAAA KEY VALUE-4