Excel / CSV – 将键值转换为CSV

我在Excel中有一个列有以下logging:

{Property1 =选入,Property2 =select退出,Property3 =select退出}
{Property1 =选入,Property2 =select退出,Property3 =select退出}
{Property1 = opt-in,Property2 = opt-in,Property3 = opt-in}

有没有办法将其转换为CSV或三个单独的列

Property1,Properyty2,Property3
select退出,退出,selectjoin
selectjoin,selectjoin,selectjoin
select退出,退出,selectjoin

为了演示,将列标题标签放入一些未使用的单元格中,并在第一个单元格的正下方使用此标准公式。

 =TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(REPLACE($A1,1,SEARCH(C$1,$A1)+LEN(C$1),""),"}",","),",",REPT(" ",LEN($A1))), LEN($A1))) 

向右下方填充。

excel_split_json

 import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import jxl.Cell; import jxl.Sheet; import jxl.Workbook; public class ExcelReader { public void excel(String input) { // TODO Auto-generated method stub try { String S = "C:/Users/DELL/Desktop/workspace_luna/ecel dataload/" + input; String S1 = "C:/Users/DELL/Desktop/workspace_luna/ecel dataload/" + input.substring(0, input.indexOf('.')) + ".xls"; File f = new File(S); @SuppressWarnings("resource") OutputStream os = (OutputStream) new FileOutputStream(f); String encoding = "UTF8"; OutputStreamWriter osw = new OutputStreamWriter(os, encoding); BufferedWriter bw = new BufferedWriter(osw); File f2 = new File(S1); Workbook w = Workbook.getWorkbook(f2); for (int sheet = 0; sheet < w.getNumberOfSheets(); sheet++) { Sheet s = w.getSheet(sheet); Cell[] row = null; for (int i = 0; i < s.getRows(); i++) { row = s.getRow(i); if (row.length > 0) { bw.write(row[0].getContents()); for (int j = 1; j < row.length; j++) { bw.write("||"); bw.write(row[j].getContents()); } } bw.newLine(); } } bw.flush(); bw.close(); } catch (UnsupportedEncodingException e) { System.err.println(e.toString()); } catch (IOException e) { System.err.println(e.toString()); } catch (Exception e) { System.err.println(e.toString()); } } }