# Thread: How to remove first seven characters in a calculated field?

1. ## How to remove first seven characters in a calculated field?

This seems as though it should be so simple but I'm missing something (maybe several things!) obvious. I did pull out my Alpha Tutorial and reference books from 1994 :-) in hope that I can find the answer tonight but maybe you can help me now.

This is what I'm using in my calculated field.
trim(NAME)+" "+rtrim(Url)+" "+trim(Tljunique)

Below is a sample of the results that I am getting.
John Smith http://www.whatever.com 66700CA

My goal is to have the below instead with the http:// removed.
John Smith www.whatever.com 66700CA

Seems as though it should be such an easy thing to do but I'm clearly blanked at the moment.

(Maybe this is why I should tweak my applications more frequently than once every five years?)

Strtran()

3. ## Re: How to remove first seven characters in a calculated field?

Slightly more long winded than Al's suggestion, but here you can see what is going on.
Code:
```x="John Smith http://www.whatever.com 66700CA"

?x
= "John Smith http://www.whatever.com 66700CA"

q=left(x,at("http",x)-1)
?q
= "John Smith "

s=substr(x,at("http",x)+7)

?s
= "www.whatever.com 66700CA"

new=q+s
?new
= "John Smith www.whatever.com 66700CA"```
Now you can make your own function and use it wherever you want.

4. ## Re: How to remove first seven characters in a calculated field?

And then it came to me...
trim(NAME)+" "+rtrim(ltrim(Url,"http://"))+" "+trim(Tljunique)
So, thanks to you both!

5. ## Re: How to remove first seven characters in a calculated field?

Jim,

I find it best to use ALLTRIM()

6. ## Re: How to remove first seven characters in a calculated field?

Keith, on your sayso I changed to ALLTRIM().

7. ## Re: How to remove first seven characters in a calculated field?

I would do this:

?alltrim(NAME)+" "+ a5_split_url(url).server +" "+alltrim(Tljunique)

Because your URL might include https, http, or neither of those two.

8. ## Re: How to remove first seven characters in a calculated field?

Steve, I never gave the https possibility a thought. Works great!

9. ## Re: How to remove first seven characters in a calculated field?

Jim

I think this thread is in the wrong forum...

What version of Alpha 5 are you using? I doubt you are using Alpha 4 if Steve's solution worked for you...

10. ## Re: How to remove first seven characters in a calculated field?

You're right, Al. I scanned down and took note of "version 7 and 8" and thought I had the correct section. I'm actually running Alpha 5 version 7. Sorry everyone.

11. ## Re: How to remove first seven characters in a calculated field?

Originally Posted by JimGatton
You're right, Al. I scanned down and took note of "version 7 and 8" and thought I had the correct section. I'm actually running Alpha 5 version 7. Sorry everyone.
I'll more it to the appropriate forum...

a5 v7 desktop
or
a5 v7 WAS

?

12. ## Re: How to remove first seven characters in a calculated field?

Desktop
Version 7, Build 4130
I was actually up to version 9 before my computer crashed but was only allowed to restore up to version 7 since version 9 was a gift. a free upgrade (hint - hint). But, it serves my purposes well.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•