chuckcou Posted October 14, 2006 Posted October 14, 2006 Last post I learned about the replace function. I have also learned about right and left words. But I have data that I can't use Replace on. Maybe left or right word, not sure. So, here it goes. Data Fields>>[color:red]imported_data(text), country_short_name(calculation), country_long_name(calculation) My [color:red]imported_data looks like this. {between words are space, not tabs} [color:green]AFGHANISTAN AF AMERICAN SAMOA AS ANTIGUA AND BARBUDA AG BRITISH INDIAN OCEAN TERRITORY IO To get the country_short_name>>I am using this calculation>>[color:purple]RightWords (Imported_Data ; 1 ) The problem is with the country_long_name>>I tried this calculation>>[color:purple]Substitute (Imported_Data;RightWords ( Imported_Data ; 1 ); "") It works, but if the coutnry_short_name is AR and if AR is in the country_long_name is substitues " " for AR. Thus, this calculation won't work :qwery: [color:brown]So, now I am stuck and that is why I have turned to you. Thanks in advance. Chuck
comment Posted October 15, 2006 Posted October 15, 2006 How about: LeftWords ( Imported_Data ; WordCount ( Imported_Data ) - 1 )
chuckcou Posted October 15, 2006 Author Posted October 15, 2006 Thanks for the quick answer comment. Yep, that works. Slick function actually. The wordcount(imported_data)-1. Cool. [color:green]Count all the word of imported_data and minus 1. :chili:
Recommended Posts
This topic is 6676 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now