-1
如何從Robot框架中的文件中刪除空行。 m使用Ride。我刪除了註釋行,但無法刪除空行。如何從Robot框架中的文件中刪除空行
下面的文件的內容是:
Settings.User = ABC Settings.Password = 1234
如何從Robot框架中的文件中刪除空行。 m使用Ride。我刪除了註釋行,但無法刪除空行。如何從Robot框架中的文件中刪除空行
下面的文件的內容是:
Settings.User = ABC Settings.Password = 1234
示例代碼可被用來從文件中刪除空行:
*** 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