本文介绍了在Emacs中添加/删除列电子表格功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 abc | efg | 123 | xyz123abc | yes xxx | bbb | cc | ddd | no 例如说,我想添加一个第3列默认值为1并删除第4列,因此数据将如下所示: abc | efg | 1 | 123 |是 xxx | bbb | 1 | cc | no 我正在研究组织模式表作为起点, | abc | efg | 123 | xyz123abc | | xxx | bbb | cc | ddd | | | | | | 解决方案我刚刚发现如何将数据导入SES(没有导入功能,但事实证明,您可以简单地yank分页数据),所以这个答案比使用表捕获更简单:)(除非你的数据包含选项卡,在这种情况下你需要解决) 。 SES是Emacs中的实际电子表格应用程序。有关详细信息,请参阅其信息节点: ses 或 (infoses) kbd> RET 处理数据: 转换您的原始数据至TSV,例如 删除该文本(例如选择区域,然后) 创建一个临时缓冲区,并改为ses-mode: * ses * ses-mode (当然, ,了解ses-mode及其关键字的描述) 将数据转入电子表格: 移动到要删除的列,并使用 将其删除 复制结果回到TSV格式的杀死环: 将修改的TSV数据转回原始缓冲区与 将选项卡转换回 | s使用 警告:我实际上在我的标准配置下出现了SES的问题,但是在 emacs -q 。 YMMV。 Given delimited data in the following format, how can I insert and delete columns?abc|efg|123|xyz123abc|yesxxx|bbb|cc|ddd|noSay, for example, that I wanted to add a 3rd column with a default value of 1 and remove the 4th column so the data would look like this:abc|efg|1|123|yesxxx|bbb|1|cc|noI was looking into org-mode tables as a starting point, however it puts extra spaces around the data.| abc | efg | 123 | xyz123abc || xxx | bbb | cc | ddd || | | | | 解决方案 Well I just found out how to import data into SES (there are no "ses-import" functions, but it turns out you can simply yank tab-separated data), so this answer is even simpler than using table-capture :) (unless your data contains tabs, in which case you'll need to work around that).SES is an actual spreadsheet application within Emacs. See its info node for details: ses , or (info "ses") To process the data:Convert your original data to TSV with, say, Kill that text (e.g. select region, then )Create a temporary buffer and change to ses-mode: *ses* ses-mode (and of course, for a description of ses-mode, and its keybindings)Yank the data into the spreadsheet: Move point to the column to delete, and kill it with Copy the result back to the kill ring in TSV format: (i.e. mark-whole-buffer + ses-export-tsv)Kill the *ses* buffer with Yank the modified TSV data back into the original buffer with Convert the tabs back to |s with Caveat: I'm actually having issues yanking into SES under my standard config, but this process works fine under emacs -q. YMMV. 这篇关于在Emacs中添加/删除列电子表格功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-23 16:38