对齐从Excel传输到cucumber的表格

对齐从Excel传输到cucumber的表格,excel,windows,cucumber,notepad++,gherkin,Excel,Windows,Cucumber,Notepad++,Gherkin,我经常需要将表格从Excel转换到cucumber。我使用Excel公式计算数据驱动测试的预期结果,因此在Excel中定义这些输入是很自然的。我的问题是,我需要用空格字符(“|”)分隔小黄瓜表列,并且需要将空格字符对齐。我目前的流程让我很接近,但最后需要恼人的手动润色步骤,对于大型桌子可能需要五分钟或更长时间。有人能建议如何改进我的流程吗 我目前的程序是: 1. Place the table headers in row one of the Excel worksheet 2. Fill t

我经常需要将表格从Excel转换到cucumber。我使用Excel公式计算数据驱动测试的预期结果,因此在Excel中定义这些输入是很自然的。我的问题是,我需要用空格字符(“|”)分隔小黄瓜表列,并且需要将空格字符对齐。我目前的流程让我很接近,但最后需要恼人的手动润色步骤,对于大型桌子可能需要五分钟或更长时间。有人能建议如何改进我的流程吗

我目前的程序是:

1. Place the table headers in row one of the Excel worksheet
2. Fill the data in each row under the headers
3. Select the headers and data in Excel and paste into a Notepad++ blank tab.  
   What follows takes place in Notepad++.
4. Using Extended search mode replace "\t" with " | " (omit the double quotes)
5. Using Extended search mode replace "\r\n" with " |\r\n" (omit the double quote)
6. Using Regular Expression search mode replace "^" with "\| " (omit the double quotes)
7. Copy a bar charcter ("|") to the clipboard
8. Select all then TextFX -> TextFX Edit -> Line up multiple lines by (Clipboard character)
9. Edit -> Blank Operations -> TAB to Space
剩下的就快到了。某些表格单元格在分隔条字符(“|”)之前缺少空格。某些单元格在分隔条字符(“|”)后有太多空格。我使用列模式修补列并替换所有列。我希望避免使用这些手动步骤

我已经搜索了网络和Stackoverflow,但没有找到任何解决我问题的方法


谢谢。

你应该用你最喜欢的脚本语言编写一个脚本。@toto你的评论让我思考,所以我更改了搜索参数并找到了。这很好地发挥了作用。谢谢。@toto我的工作理念是只有在创新(即将现有解决方案应用于新情况)失败时才能发挥创造性。现在,当我在我自己的时间,那是一个不同的故事。:-)如果您经常需要这样做,您也可以考虑将Excel文件放在您的特征文件旁边,并使用文件名引用和一些库来从Excel文件中直接检索数据。