If my list has 80 lines.
The data are in the list named Source
Now I want to take the first 20 lines.
Do I just use List Processing > Get Line - By Number?
I tried it, but it only get the top (line number zero) line.
----
I also tried this c# code
// path to file
string path = project.Variables["pathToKeyWordFile"].Value;;
// create a list of all strings
var lines = new List<string>();
// get the number of all lines
int count = Convert.ToInt32(Macros.FileSystem.FileCountOfLines(path));
// load all lines into the list
for(int i = 0; i < count; i++)
{
lines.Add(Macros.FileSystem.FileGetLine(path, i.ToString(), false));
}
// return keywords via; in the specified range from 3 to 6
// i.e. starting from the 2nd index in the amount of 4 pieces
return string.
For pathToKeyWordFile, do I put the full file path of the text file?
Should it be folder/folder2/file.txt or folder\folder2\file.txt?
The data are in the list named Source
Now I want to take the first 20 lines.
Do I just use List Processing > Get Line - By Number?
I tried it, but it only get the top (line number zero) line.
----
I also tried this c# code
mySnippetsZenno/[lists списки]/listGetItemRange список взять диапазон.cs at master · AZANIR/mySnippetsZenno · GitHub
Collection snippets c# from Zennoposter. Contribute to AZANIR/mySnippetsZenno development by creating an account on GitHub.
github.com
// path to file
string path = project.Variables["pathToKeyWordFile"].Value;;
// create a list of all strings
var lines = new List<string>();
// get the number of all lines
int count = Convert.ToInt32(Macros.FileSystem.FileCountOfLines(path));
// load all lines into the list
for(int i = 0; i < count; i++)
{
lines.Add(Macros.FileSystem.FileGetLine(path, i.ToString(), false));
}
// return keywords via; in the specified range from 3 to 6
// i.e. starting from the 2nd index in the amount of 4 pieces
return string.
For pathToKeyWordFile, do I put the full file path of the text file?
Should it be folder/folder2/file.txt or folder\folder2\file.txt?
Вложения
-
60,1 КБ Просмотры: 85