I have a CSV file that have some currency fields.
These fields do not have the dollar ($) sign or comma (,) for separating thousands.
I want to be able to tell TextPipe to format those numeric fields with currency symbol and thousands separator (comma). And also would be nice to have the option of specifying decimal places, rounding, adding or removing sign, etc. in a filter for number formatting.
Is this something that can be done another way right now?
Thank you
Othni
Formatting Currency and Numbers
Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Formatting Currency and Numbers
Hi Othni,
Use a CSV field restriction (Filters\Restrict\Delimited fields (CSV, Tab, Pipe, etc)) to restrict to just the content of the field you need.
Inside this filter, add a Filters\Add\Left margin filter with text of '$'.
As for the commas, the best approach would be to reverse the field, add a comma every 3 characters, and then reverse it back (and then add the $ sign).
To reverse a field, use Filters\Special\Reverse each line
Use a CSV field restriction (Filters\Restrict\Delimited fields (CSV, Tab, Pipe, etc)) to restrict to just the content of the field you need.
Inside this filter, add a Filters\Add\Left margin filter with text of '$'.
As for the commas, the best approach would be to reverse the field, add a comma every 3 characters, and then reverse it back (and then add the $ sign).
To reverse a field, use Filters\Special\Reverse each line
Re: Formatting Currency and Numbers
Thank you for the quick response.
Re: Formatting Currency and Numbers
Ok, I was not able to find how to insert a comma after each three numbers.
- DataMystic Support
- Site Admin
- Posts: 2227
- Joined: Mon Jun 30, 2003 12:32 pm
- Location: Melbourne, Australia
- Contact:
Re: Formatting Currency and Numbers
Use Filters\Convert\End of line characters
- set the input to 'Fixed length: 3'
and set the output to a comma.
- set the input to 'Fixed length: 3'
and set the output to a comma.