简体   繁体   中英

Converting Excel to JSON using Dataweave in anypoint studio

Need to transform Excel to JSON using Dataweave in Anypoint Studio.

Mule Datamapper supports converting Excel files to JSON directly,where as in DataWeave it won't support Excel to JSON conversion.

In a blog i found that using POI libraries we can do this but it is a bit complex work.

Is there any alternative way to do this?

Excel (XLSX files) support for DataWeave (the data transformation processor) has been released with the new Anypoint Studio 6.1.2 version w/3.8.2 Runtime.

Please see how to use it here: Excel format in DataWeave

And the release notes below:
https://docs.mulesoft.com/release-notes/anypoint-studio-6.1-with-3.8.2-runtime-update-site-2-release-notes

I don't think there is any Excel transformer in 3.7 unless you want to use DataMapper which is deprecated. Yes, some work but you can use Apache POI like below -

  1. Convert Excl to CSV using Java Transformer - I found this apache sample generic class here
  2. Now, Once you have the CSV, send that to DataWeave and do your CSV to JSON transformation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM