我有电子表格,我需要将一个单元格的内容拆分到两个单元格中。
单元格内容如下。 姓名19:00:00
我需要将其拆分为两个单元格:Name 和 19:00:00
我正在使用 apache poi 来读取 Excel 文件。有没有更好的库来读取 Excel 文件并使用它。我需要从数据表中删除几列。
最佳答案
你也可以做类似的事情
step 1 : read value which is in your case is : "Name 19:00:00" into one temporary String,
step 2 : unmerge cell using apache poi's workSheet.removeMergedRegion(index - of the region to unmerge). refer this.
step 3 : split string what you received into step-1, from space, so you get array of String which is most likely, ary[0] = Name , ary1 = 19:00:00
step 4 : write ary[0] into unmerged first cell and likewise for another one as per you wish.
关于java - 如何使用java将一个Excel单元格拆分为两个单元格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36053284/