Is there any way to trim or limit a variable to 40 characters? I am imputing data into excel and for my purposes the data can only be 40 characters long.
With the Trim> command?
Thanks for your help
Trim
Moderators: Dorian (MJT support), JRL
MidStr> rather than Trim>
Code: Select all
Let>var=whatever alphanumeric string you want the variable to be
Midstr>var,1,40,var
mdl>var
-
- Newbie
- Posts: 18
- Joined: Wed Aug 18, 2010 5:51 pm
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
We don't do Java here, but Google is your friend
-
- Newbie
- Posts: 18
- Joined: Wed Aug 18, 2010 5:51 pm
exception
How would I go about adding an exception here? For the times when the variable is less than 40 characters?
Thanks for your help/patience
Thanks for your help/patience
-Ben
-
- Pro Scripter
- Posts: 60
- Joined: Tue Dec 22, 2009 9:51 am
- Location: Mannheim ( Germany )
- Contact:
if >40 or <40
Let>var=whatever alphanumeric string you want the variable to be
Length>var,varlength
IF>varlength>40
// if above 40 cut to 40
Midstr>var,1,40,var
ELSE
Midstr>var,1,10,var
// if less 40
ENDIF
mdl>var
Kind regards
Oli
Length>var,varlength
IF>varlength>40
// if above 40 cut to 40
Midstr>var,1,40,var
ELSE
Midstr>var,1,10,var
// if less 40
ENDIF
mdl>var
Kind regards
Oli
Oliver Hilger Mannheim
alias Olllllliii
alias Olllllliii