web stats
Conditionally Edit CSV Help - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-17-2015, 09:56 PM
mshort mshort is offline
Mirth Newb
 
Join Date: Apr 2015
Posts: 7
mshort is on a distinguished road
Default Conditionally Edit CSV Help

Hello,

I'm using Mirth Connect 3.2.1.7650. [Mirth amateur here, so go easy on me]

I'm wanting to conditionally edit specific values in a csv. I've used a similar transformer logic to conditionally edit repeating HL7 fields and it worked fine. This is my first time working with csv files and looking to do the same. The csv looks like:
last_name,first_name,dob
mouse,mickey,4/25/1946
duck,donald,7/7/1977
doo,scooby,1/1/1901
My destination transformer simply looks like:
for(var i = 0; i< msg['row'].length(); i++) {
if (msg['row'][i]['column1'].toString() == "mouse") {

msg['row'][i]['column1']= "test";
}
}
I'm attempting to set the last_name = "test" if the last_name = "mouse", however I can't seem to get this update/replace/set to actually happen.

[I've attached my channel if it helps]

Any help is greatly appreciated!
Attached Files
File Type: xml CSV_Manipulator.xml (17.1 KB, 9 views)
Reply With Quote
 

Tags
conditionally, csv, edit, iterate, text file

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 07:01 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation