Posted: Mon Oct 09, 2006 10:23 am Post subject: insert a row in a file using sort
Hi,
how can the below task can be done using sort/icetool?
input data:
aaaa
aaaa
bbbb
bbbb
bbbb
cccc
cccc
cccc
cccc
data tag needs to be included before bbbb row starts and after bbbb row ends.
output data:
aaaa
aaaa
data
bbbb
bbbb
bbbb
data
cccc
cccc
cccc
cccc
I want this to be done without splitting the file data. I want this to be done like read through each row and when bbbb row starts put "data" tag and when it ends put "bbbb" tag without actually splitting data using sort/icetool.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Oct 09, 2006 11:19 am Post subject:
Can we use before the start of the first 'cccc' row, instead of after the end of the last 'bbbb' row, to identify where the second data tag goes?
If not, are there always three bbbb records or can there be a different number of bbbb records? Is it always the second group of records you want the data tags around? I'm looking for more information about the pattern here that we can use. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Hi Kolusu,
I tried your solution but it did not work out for me. It seems, i do not have latest icetool PTFs as it is throwing error at IFTHEN and OVERLAY statements. Is it possible to do without using those statements?
Hi Frank,
I want to have the data tag only before and after bbbb. Any number of bbbb data lines can be present and it may not always be second group.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Tue Oct 10, 2006 8:51 am Post subject:
Quote:
Hi Kolusu,
I tried your solution but it did not work out for me. It seems, i do not have latest icetool PTFs as it is throwing error at IFTHEN and OVERLAY statements. Is it possible to do without using those statements?
ikumar,
You need to post the exact error messages, so that we can help you.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum