View previous topic :: View next topic
|
Author |
Message |
rups
New User
Joined: 19 Jan 2006 Posts: 17 Location: bangalore
|
|
|
|
Hi All,
i am having input file in the format
,wwww;wwwww
wwwwwww,ww
the length of the file is 38 .And i want the out put file in the format
,w;w
w,w
i want to replace the w's by a single w.the count of w's is not constant in input file.
can this be done using inspect statement?if not is there any other method? |
|
Back to top |
|
|
Lkmi
New User
Joined: 04 Mar 2005 Posts: 53 Location: Newyork
|
|
|
|
I think we can try replacing 'wwww;' by 'w;'.
i.e, if the number of w's + ; is constant.
after this, again a replace can be made for wwww+ blank to replace the last string.
iam not sure abt this..Its just an idea. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Hi Rups,
Are you sure in your Input file DELIMITERS between Ws are only COMMA & SEMICOLON ?
Regards,
Priyesh. |
|
Back to top |
|
|
rups
New User
Joined: 19 Jan 2006 Posts: 17 Location: bangalore
|
|
|
|
Hi priyesh,
I am having 11 lakh records in my input file and the delimiters that comes in each record will vary.
i am having in put record this format
wwww wwww www
www,wwww.ww
ww
ww * ww
$$ ww $$
** ww
wwww * ww
( www |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
So what about output for the other records having *, SPACE, ( , ) , $, ** etc...
After looking at INPUTs seems like you just want to replace all contiguous Ws with a single W. Is it correct or you are looking for somethig else ?
Regards,
Priyesh. |
|
Back to top |
|
|
rups
New User
Joined: 19 Jan 2006 Posts: 17 Location: bangalore
|
|
|
|
yes i just want to replace all w's by single w,and special characters will remain as it is.
ex: input- $$ www $$
output-$$ w $$ |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
rups....
Easiest way to achieve this is to issue below mentioned command to the input file at EDIT MODE.
Code: |
Command ===> C all WW W |
As your input file LRECL is 38 in the worst case you'll have to issue this command only 6 times. And that I think is far worthy coding a program.
P.S. Dont forget to back up your INPUT File before EDIT for reference.
Regards,
Priyesh. |
|
Back to top |
|
|
rups
New User
Joined: 19 Jan 2006 Posts: 17 Location: bangalore
|
|
|
|
Thanks priyesh.I will try that.
Thanks
Rups |
|
Back to top |
|
|
|