truncate trailing zeroes
Moderators: chulett, rschirm, roy
truncate trailing zeroes
My sequential file looks like ..
col1 col2 col3
1 100100 123
2 200000 234
3 199900 245
4 329800 424
5 345000 125
6 234500 235
I want to convert this file to..
col1 col2 col3
1 1001 123
2 2000 234
3 1999 245
4 3298 424
5 3450 125
6 2345 235
i.e i need to supress last two zeroes in col2 and load into target.
I used the trim(col2,"0","T"),its taken out all trailing zeroes..
Please guide me how to takeout last two zeroes from col2.
Thanks
col1 col2 col3
1 100100 123
2 200000 234
3 199900 245
4 329800 424
5 345000 125
6 234500 235
I want to convert this file to..
col1 col2 col3
1 1001 123
2 2000 234
3 1999 245
4 3298 424
5 3450 125
6 2345 235
i.e i need to supress last two zeroes in col2 and load into target.
I used the trim(col2,"0","T"),its taken out all trailing zeroes..
Please guide me how to takeout last two zeroes from col2.
Thanks
-
- Charter Member
- Posts: 130
- Joined: Mon Sep 06, 2004 3:05 am
- Location: Dubai,UAE
Hi Edward,
Substrings(Source.Col,1, Len(Source.Col)-2)
Left(Source.Col,Len(Source.Col)-2)
I am sure there are many more ways of achieving the result.
Substrings(Source.Col,1, Len(Source.Col)-2)
Left(Source.Col,Len(Source.Col)-2)
I am sure there are many more ways of achieving the result.
Warm Regards,
Amruta Bandekar
<b>If A equals success, then the formula is: A = X + Y + Z, X is work. Y is play. Z is keep your mouth shut. </b>
--Albert Einstein
Amruta Bandekar
<b>If A equals success, then the formula is: A = X + Y + Z, X is work. Y is play. Z is keep your mouth shut. </b>
--Albert Einstein
-
- Premium Member
- Posts: 1255
- Joined: Wed Feb 02, 2005 11:54 am
- Location: United States of America
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: