Board logo

标题: [问题求助] 如何根据CSV文件的标头和级别来创建文件夹 [打印本页]

作者: 5i365    时间: 2021-12-4 13:36     标题: 如何根据CSV文件的标头和级别来创建文件夹

本帖最后由 5i365 于 2021-12-4 13:55 编辑

对powershell的csv操作不太懂, 手上有个csv文件, 想根据CSV文件的标头和级别来创建一层一层的文件夹, 高手可以试试, 不知道能不能实现
CSV文件的层次如下图:



CSV文件写在了下面的代码中
  1. $s = @'
  2. "级别 0","级别 1","级别 2","级别 3","级别 4","级别 5"
  3. "中心主题","","","","",""
  4. "","主题1","","","",""
  5. "","","子主题1","","",""
  6. "","","子主题2","","",""
  7. "","","","子主题1","",""
  8. "","","","子主题2","",""
  9. "","","","","子主题1",""
  10. "","","","","","子主题1"
  11. "","","","","","子主题2"
  12. "","","","","子主题2",""
  13. "","主题2","","","",""
  14. "","","子主题1","","",""
  15. "","","","子主题1","",""
  16. "","","","子主题2","",""
  17. "","","","","子主题1",""
  18. "","","","","子主题2",""
  19. "","主题3","","","",""
  20. "","","子主题1","","",""
  21. "","","","子主题1","",""
  22. "","","","子主题2","",""
  23. "","","","","子主题1",""
  24. "","","","","子主题2",""
  25. "","","","","","子主题1"
  26. "","","","","","子主题2"
  27. "","","子主题1","","",""
  28. "","","","子主题1","",""
  29. "","","","子主题2","",""
  30. "","","","","子主题1",""
  31. "","","","","子主题2",""
  32. '@
  33. $c = ConvertTo-Csv $s
复制代码





欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2