- Регистрация
- 08.07.2013
- Сообщения
- 81
- Благодарностей
- 1
- Баллы
- 8
Hi,
So I have this snippet from a fellow member on this forum. Snippet is this:
// Delete blank lines from file
string path = project.Variables[@"{-Project.Directory-}Accounts.txt"].Value; // Gets file path from your project variable with name "filePath"
var lines = System.IO.File.ReadAllLines(path).Where(arg => !string.IsNullOrWhiteSpace(arg));
System.IO.File.WriteAllLines(path, lines);
return 0;
I have edited the snippet slightly and added the "@" before project directory path. It wont work without this. The issue is that Zenno picks up the file path but says no such variable so the .txt file Accounts.txt cannot be found. Accounts.txt exists so I am not sure what I am doing wrong. I am trying to delete all empty lines in the .txt file. Help is appreciated.
Thanks
So I have this snippet from a fellow member on this forum. Snippet is this:
// Delete blank lines from file
string path = project.Variables[@"{-Project.Directory-}Accounts.txt"].Value; // Gets file path from your project variable with name "filePath"
var lines = System.IO.File.ReadAllLines(path).Where(arg => !string.IsNullOrWhiteSpace(arg));
System.IO.File.WriteAllLines(path, lines);
return 0;
I have edited the snippet slightly and added the "@" before project directory path. It wont work without this. The issue is that Zenno picks up the file path but says no such variable so the .txt file Accounts.txt cannot be found. Accounts.txt exists so I am not sure what I am doing wrong. I am trying to delete all empty lines in the .txt file. Help is appreciated.
Thanks