本帖最后由 5i365 于 2021-12-4 13:55 编辑
对powershell的csv操作不太懂, 手上有个csv文件, 想根据CSV文件的标头和级别来创建一层一层的文件夹, 高手可以试试, 不知道能不能实现
CSV文件的层次如下图:
CSV文件写在了下面的代码中- $s = @'
- "级别 0","级别 1","级别 2","级别 3","级别 4","级别 5"
- "中心主题","","","","",""
- "","主题1","","","",""
- "","","子主题1","","",""
- "","","子主题2","","",""
- "","","","子主题1","",""
- "","","","子主题2","",""
- "","","","","子主题1",""
- "","","","","","子主题1"
- "","","","","","子主题2"
- "","","","","子主题2",""
- "","主题2","","","",""
- "","","子主题1","","",""
- "","","","子主题1","",""
- "","","","子主题2","",""
- "","","","","子主题1",""
- "","","","","子主题2",""
- "","主题3","","","",""
- "","","子主题1","","",""
- "","","","子主题1","",""
- "","","","子主题2","",""
- "","","","","子主题1",""
- "","","","","子主题2",""
- "","","","","","子主题1"
- "","","","","","子主题2"
- "","","子主题1","","",""
- "","","","子主题1","",""
- "","","","子主题2","",""
- "","","","","子主题1",""
- "","","","","子主题2",""
- '@
- $c = ConvertTo-Csv $s
复制代码
|