如何从Robot框架中的文件中删除空行。我用骑。我删除了注释行但无法删除空行。
文件内容如下:
Settings.User = abc Settings.Password = 1234
答案 0 :(得分:0)
可用于从文件中删除空白行的示例代码:
*** Test Case ***
first test
${contents}=Get File data.txt
Create File data2.txt @{lines}=Split to lines ${contents}
:FOR ${line} IN @{lines}
\ ${length}= GetLength ${line}
\ Run Keyword if ${length} != 0\ Append To File data2.txt ${line}\n