Txt file


I have a txt file which number of lines is variable and I need to delete the first and last line can someone help me?

@LucasSilva - Here you go…

  1. Assign – > StrLines = File.ReadAllLines(FileName)

StrLines is String Array

  1. Invoke Code:


File.WriteAllLines(NewFileName,readlines.Skip(1).Take(readlines.Count() - 2))

Invoke Code arguments

Input and Output:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.