I have some questions about manipulating the contents of a $:
- I’m trying to standardize the look of a nummeric variable field.
The input can be for example:
1000000
1.000.000
1,000,000
they all should finally look like:
1.000.000
I can only think of getting the length of the string and use substring to clear potential dots etc. then reverse the string and insert dots after every 3 digits and reverse it again but probably this is much easier done in Perl?
- What is the quickest way to clear all characters except the digits from a string?
- Let’s say you have a datafile with a nummer of fields seperated by “:”. You don’t want to store a new record to this file with a variable with “:” in it as it will mess up the record when reading it from the datafile. What is the fastest way to check all fields for “:” and replace it with for example “;” before saving it?
Raoul
[sig][/sig]
- I’m trying to standardize the look of a nummeric variable field.
The input can be for example:
1000000
1.000.000
1,000,000
they all should finally look like:
1.000.000
I can only think of getting the length of the string and use substring to clear potential dots etc. then reverse the string and insert dots after every 3 digits and reverse it again but probably this is much easier done in Perl?
- What is the quickest way to clear all characters except the digits from a string?
- Let’s say you have a datafile with a nummer of fields seperated by “:”. You don’t want to store a new record to this file with a variable with “:” in it as it will mess up the record when reading it from the datafile. What is the fastest way to check all fields for “:” and replace it with for example “;” before saving it?
Raoul
[sig][/sig]