I've got tables of information. Some of the cells are not properly formatted. They are displaying numbers instead of properly formatted currency. 150000 instead of $150,000. Sometimes it's 150000. when it needs to be $150,000.
I have to use the tags in the definition because of the various similar permutations of the same number.
For some reason if I use these as parameters in a StringReplace statement, nothing happens. I assume it's something to do with the 'special' characters such as the ($) and/or the (,) but I just can't seem to figure it out.
Any help would be very much appreciated.
Thanks in advance...
StringReplace: How do I also include commas?
Moderators: Dorian (MJT support), JRL
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Let>comma=,
StringReplace>some_string,comma,replacement,new_string
StringReplace>some_string,comma,replacement,new_string
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Hi, Marcus.
I tried your suggestion. This is the actual lines of code that I'm trying to work with. I wasn't sure whether to use the Let> before each line or not, so I started by trying it just once before them all. Here is the actual code I'm using.
Let>comma=,
StringReplace>theFileData,150000,$150comma000,theFileData
StringReplace>theFileData,$150000,$150comma000,theFileData
StringReplace>theFileData,150000.,$150comma000,theFileData
StringReplace>theFileData,150comma000,$150comma000,theFileData
The first 3 StringReplace> commands resulted in this:
$150comma000
The 4th one in this:
150,000
Is there any sort of 'bracketing' that can go around the Source and/or the Result data so that any punctuation, or anything but the actual characters/character spaces will be seen and not their inherent values? Sort of like "Source","Result". Would it be % like with commands (%CRLF%)?
Thanks again.
Ronen Ben-Hai
Zutphen, Netherlands
I tried your suggestion. This is the actual lines of code that I'm trying to work with. I wasn't sure whether to use the Let> before each line or not, so I started by trying it just once before them all. Here is the actual code I'm using.
Let>comma=,
StringReplace>theFileData,150000,$150comma000,theFileData
StringReplace>theFileData,$150000,$150comma000,theFileData
StringReplace>theFileData,150000.,$150comma000,theFileData
StringReplace>theFileData,150comma000,$150comma000,theFileData
The first 3 StringReplace> commands resulted in this:
$150comma000
The 4th one in this:
150,000
Is there any sort of 'bracketing' that can go around the Source and/or the Result data so that any punctuation, or anything but the actual characters/character spaces will be seen and not their inherent values? Sort of like "Source","Result". Would it be % like with commands (%CRLF%)?
Thanks again.
Ronen Ben-Hai
Zutphen, Netherlands
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
You need:
StringReplace>theFileData,150000,$150%comma%000,theFileData
Please see the user guide section on using variables.
StringReplace>theFileData,150000,$150%comma%000,theFileData
Please see the user guide section on using variables.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?