Cold Fusion - Remove characters from a string
Good afternoon all. I am working on a process that pulls in lines from a file one at a time. Each string is basically a list of tilde delimited values. Some of these values can vary in length or be NULL. I need to remove a few of those tildes with NULL values between them. For instace, my string may look something like the line below. I need to remove all but one of the tildes in that group at the end.
I have worked with ListDeleteAt() and tried to hit particular position number but that didn't quite work the way I'd hoped. I also worked with RemoveChars() a bit but those tildes are a different spot in each line. I am currently using the following but there may be a string of NULLs before the group I need to remove:
<cfset row = replace(row,"~~~~~~~~~","~","ONE")>
Any help would be appreciated.
MEPMD01~2POOP519~03092019113800PM~6480081580~~~1224714818389~OK~E~KWH~~000015~48~03092019124500AM~00~0.3414~00~0.3396~00~0.1182~00~0.0552~00~0.069~00~0.0642~~~~~~~~~00~0.0606~00~0.081
