在excel json字符串中放入excel中的单独列 [英] In excel json string and put into separate column in excel

查看:653
本文介绍了在excel json字符串中放入excel中的单独列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在excel数据中如下

In excel data as follows

Empid  status   Suggestions

 1    Active   "Empid":"1","Empname":"Ram"
 2    Active   "Empid":"2","Empname":"Sam","Age":"30"



从上面我想把json字符串放入excel中的每一列,我的输出如下


From the above i want to put json string into each column in excel, my output as follows

Empid   status     Empid   Empname   Age
   1    Active     1       Ram       Null
   2    Active     2       Sam       30



获取输出如何在asp.net中使用c#



我尝试过:



excel数据如下




for getting output how to do in asp.net using c#

What I have tried:

In excel data as follows

Empid  status   Suggestions
  1    Active   "Empid":"1","Empname":"Ram"
  2    Active   "Empid":"2","Empname":"Sam","Age":"30"



从上面我想把json字符串放入excel中的每一列,我的输出如下


From the above i want to put json string into each column in excel, my output as follows

Empid   status     Empid   Empname   Age
   1    Active     1       Ram       Null
   2    Active     2       Sam       30



获取输出如何在asp.net中使用c#


for getting output how to do in asp.net using c#

推荐答案

您可以将数据从Excel导出为CSV;使用说*作为分隔符(因为:,,等已经使用过了。



然后读回来的行,拆分在:上,,等获取json字符串。
You can "export" the data from Excel as CSV; using say "*" as a delimeter (because ":,,etc" are already used.

Then read the lines back in, "splitting" on ":", ",", etc. to get the "json strings".


将Excel xlsx文件解析为javascript对象列表,并可选择将该列表编写为JSON编码 Mail Archiver [ ^ ]。



Parse Excel xlsx files into a list of javascript objects and optionally write that list as a JSON encoded Mail Archiver[^].

convertExcel = require('excel-as-json').processFile;
convertExcel(src, dst, options, callback);


这篇关于在excel json字符串中放入excel中的单独列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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