Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Nifi || Mail || Display csv files content in tabular format.

avatar
Contributor

Hi All,

 

I have to display the records of csv file over mail body in tabular format using Putmail.

 

I am extracting records by executing sql which is scheduled at some duration and than forwarding the same using putmail to some specific users.

 

Can someone please tell me how to display the data of generated csv file in tabular format.current_flow_1.png

 

 

1 ACCEPTED SOLUTION

avatar
Super Guru

To get it into a table, you need something like this:

 

<table><tr><td>
${'$1':replace(',','</td><td>'):replace('\n','</td></tr>\n<tr><td>')}
</td></tr></table>

 

and it should output an HTML Table like this:

 

<table><tr><td>
Release Cause</td><td>Previous Count</td><td>Current Count</td><td>Change_Ratio</td><td>SEVERITY</td>
</tr><tr><td>SIP: [487] Request Terminated</td><td>173</td><td>393</td><td>1.271676300578034682</td><td>Critical
</td></tr></table>

 

You may have to play with the last </td></tr> depending on if you have an empty line on bottom or not.

You may also have to adjust \n to \r\n again depending on the source file actual return chars (not seen they are hidden).

 

View solution in original post

10 REPLIES 10

avatar
Contributor

Yes Sumita, it worked.