RE: Read Text File

Hi,

I’m having 30 lines in one text file, I need to read only first 10 lines from it. Can anyone help me with the solution?

Hi @pradeep931

first read your text file…you will get big string(suppose it is st1)…create string array and split your st1 as per single lines…you will get array of lines…use foreach loop on it upto first 10 lines…

use following to convert string into string array as per line by line

st1.Split(CChar(vblf)) --st1 is your string getting from text file read.store this result in string array

enjoy!!

1 Like

You can use this Regex pattern “(\A(?:.*\n){10})” in Matches activity

1 Like

Thank you Arjun, i will try it

Thanks Srujan.