如何通过Azure Logic App使用模板将CSV转换为JSON [英] How to convert CSV to JSON using template via Azure Logic App

查看:130
本文介绍了如何通过Azure Logic App使用模板将CSV转换为JSON的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用内置/托管/第三方模板将CSV转换为JSON,而无需通过Azure Logic App使用Azure功能?

Is it possible to convert CSV to JSON using built-in/managed/3rd party template, without using Azure Function via Azure Logic App?

下面使用的是自动生成的Azure函数.但是,我找不到所提到的链接.理想情况下,不需要Azure功能.

Below is using Azure Function, which is generated automaticately. However, I cannot find the link like what it mentions. Ideally, no Azure function is required.

http://blogs.recneps .org/post/Processing-a-flat-file-with-Azure-Logic-Apps

https://social.msdn.microsoft.com/Forums/zh-CN/e0ea1adc-1979-44df-a4d1-52290338bc78/transform-csv-in-logic-app?forum=azurelogicapps

以下,没有CSV到JSON的可用.

Below, No CSV to JSON available.

https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-enterprise-integration-liquid-transform

推荐答案

我承认这不是我最引以为傲的工作,但似乎效果很好.我能够将onedrive中的CSV文件转换为JSON对象.

I will admit this is not my proudest work but it seems to work fairly well. I was able to turn a CSV file from my onedrive into JSON objects.

///使用更少的变量,拆分,设置和替换操作进行了更新

//Updated with less variables, splits, set and replaces actions

输入

输出(需要清除第二个对象,第一个对象和最后一个对象)

Output(second object, first object and last needs to be purged)

如何?但是,很多步骤可能会被删除和合并.通过使用split和replace动作,我可以选择每一行,然后在该行下创建一个JSON对象.我首先要使用数组,但最终,将它变成JSON对象并不难. 不能完全确定它如何与空值一起使用.

How? A lot of steps that could possibly be removed and merged but. Using splits and replace actions I could single out each line and down the line create a JSON object. I was going first for an array but eventually, it was not that hard to make it into a JSON object. Not entirely sure how it works with null values.

这可能不是处理此问题的最佳方法,这里的缺点是动作很多,第一个对象是标头,需要删除,最后一个对象只是null (很好).

This is probably not the best way to handle this, drawbacks here is that it is a lot of actions, the first object is the headers and that needs to be removed, there will also be a very last object that is just null(which is fine).

整个架构

此处的并发设置为1

Concurrency set to 1 here

这篇关于如何通过Azure Logic App使用模板将CSV转换为JSON的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆