SOLVED
Have text file where minus sign is at end of string instead of beginning
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
sgrabish1
8 - Asteroid
‎05-14-2019
11:42 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I have a text file that has negative numbers where the minus sign is at the end of the string instead of the beginning.
I tried used multi-field formula to identify the instances where this has occurred. I need my final output to be numeric where the minus sign is moved to the beginning and can be converted into a numeric value with its respective negative value.
Any help here greatly appreciated!
Thanks,
Stan
Solved! Go to Solution.
Labels:
- Labels:
- Common Use Cases
- Expression
- Parse
1 REPLY 1
jamielaird
14 - Magnetar
‎05-14-2019
11:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @sgrabish1
Something like this will do the trick. Use a multi-field formula. You can simplify the formula significantly if you tidy up all the whitespace first.
ToNumber(IF Right(Trim([Field1]),1) = '-'
THEN ToNumber(Left(Trim([Field1]),Length(Trim([Field1]))-1))*-1
ELSE Trim(Field1)
ENDIF)
