# Take all text from a txt file but skip the first line?

#### zmike

##### Client
Hi Zenno friends,

I am trying to process a txt file, in which contain the article title in the first line, and the article content in the other lines.

Here is what I tried so far:

First, Get the article by using Read file > Take Text > save into {-Variable.article-}
Next, Save the {-Variable.article-} into a list.
Finally, Get line and use By number, where I entered 1-end, trying to get all lines except the 0 line, which is the title.

However, it seems that I have done something wrong, the 1-end is not working.
ZP7 only read the number 1.
I tried to put the word "end" under "By Number", it works, it does get the last line.
I also tried to put random, it works too.

Any help would be appreciated!

Plus, is there any way to "Get line" directly from a txt file?

#### zmike

##### Client
Get Line will only work with 1 line?

#### orka13

##### Client
Get Line will only work with 1 line?
yes. use another algorithm:
1. Delete 1st line from list.
2. "Merge list items"

Or use this C# code to read file skipping first line. But first create variable Path with path to file (C:\text.txt) and variable without1 (code will save text in it):
C#:
IEnumerable<string> strings = File.ReadLines(project.Variables["Path"].Value).Skip(1);
string joinedString = string.Join("\r\n", strings);
project.Variables["without1"].Value = joinedString;

Последнее редактирование:
zmike

#### zmike

##### Client
Thank you orka13

It works like a charm!
I create path and without1 variable, and setup a default value for path.
The code below output my text content without the first line.