You would use calculation such as: Left ( yourField ; 1 )
You can create calculation or simply set another field with this returned value, such as:
Set Field [ FieldB ; Left ( yourField ; 1 ) ]
thanks for a quick answer.
I began to create a script based on the last of your two examples, but is this calculation correct? I get the "an operator is expected here" error? It is highlighted between FieldB and Left... And I for sure can't figure out why or which operator there should be...
I figured it out, but thanks anyway
and this small but effective script saves a ton of manual work for me :9
Andreas, I don't know if FieldB is in a related table but if it is only setting another field within the same record then you can eliminate script and have it change automatically by using an auto-enter (replace):
Go to FieldB and Options. In Auto-Enter tab, select 'by calculation' and type into calculation dialog Left ( yourField ; 1 ) then say OK. Back at auto-enter tab, uncheck 'Do not Replace Existing Value...'
Now whenever you change the data in yourField, FieldB will inherit the first letter.
oh, thanks, I hadn't explored that possibility yet
it's is even smother do have done like this
Maybe you can help me with another similiar small script solution?
How do I copy all character after the 8th character?
It helps to have an idea of the type of data but in general, the calculation you would use might be:
Let ( l = Length ( yourField ) ; Right ( yourField ; l - 8 ) )
But if this field contains sentences, you might want to wrap with Trim() to remove any *leading spaces as:
Let ( l = Length ( yourField ) ; Trim ( Right ( yourField ; l - 8 ) ) )
* this protects from situation similar to: 12345678 moredata. Using only the first calc would produce a space then moredata.
isn't space a "character"?
the field is a textfield and only has digits, a period, a dash and two spaces in the first 8 characters. The sequence look like this;
"01.01 - "
(ity is my field for Episode Name for my tv series collection, that I want to seperate into different tables)
It would help alot to have a script to remove these 8 leading characters instead of manually do it on all the 100's of records...
I will try this out and see if I can get it to work.
Yes space is a character. What I meant is that if the 9th character was a space you might want to remove it from the resulting text string. The calculation I provided then will work as is. :^)
the 9th is a letter (or very seldom a digit)
and the script works