excel - 列出 zip 子目录中的文件
问题描述
要列出电子表格(xlsx)文件中的所有文件,我可以这样做:
$ unzip -l /Users/david/Desktop/myspreadsheet.xlsx
698 01-01-1980 00:00 xl/_rels/workbook.xml.rels
1415625191 01-01-1980 00:00 xl/worksheets/sheet1.xml
6798 01-01-1980 00:00 xl/theme/theme1.xml
2315 01-01-1980 00:00 xl/styles.xml
779218 01-01-1980 00:00 xl/sharedStrings.xml
322 01-01-1980 00:00 xl/worksheets/_rels/sheet1.xml.rels
9840 01-01-1980 00:00 xl/printerSettings/printerSettings1.bin
640 01-01-1980 00:00 docProps/core.xml
797 01-01-1980 00:00 docProps/app.xml
从这里我们可以看到电子表格有一张 - xl/worksheets/sheet1.xml
。有没有办法只查看xl/worksheets/
文件夹的 zip 内容?例如,执行以下操作:
$ unzip -l /Users/david/Desktop/myspreadsheet.xlsx xl/worksheets
我能从man那里找到的最多的是:
-l list archive files (short format). The names, uncompressed file sizes and modification dates and times of the specified files are printed, along with totals for all files specified. If UnZip was compiled with OS2_EAS defined, the -l option also lists columns for the sizes of stored OS/2 extended attributes (EAs) and OS/2 access control lists (ACLs). In addition, the zipfile comment and individual file comments (if any) are displayed. If a file was archived from a single-case file system (for example, the old MS-DOS FAT file system) and the -L option was given, the file- name is converted to lowercase and is prefixed with a caret (^).
但似乎还有很多其他选择。有没有办法做到以上几点?
解决方案
推荐阅读
- java - Eclipse: 未能执行目标 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default): 命令执行失败
- android - Android Picasso - 我怎么知道内存问题已解决?
- python - 如何替换文本文件特定列的多行
- c# - 在下一种情况下(区间包含),您的预期行为是什么?
- postgresql - Postgres - SELECT函数()和CALL函数()之间的区别?
- angular - 带前缀的测试时间输入字段
- angular - 当我在 ag-grid 中使用特定的 customCellRenderer 时,GridReady 事件不起作用
- ios - 如何旋转到只有一个视图控制器的横向
- javascript - 调用异步函数但同步返回结果
- python - 如何将 .values_counts() 用于数据框中的列表项