1
Answer

Searching for a string in text file and storing the perticular line that matches the string

Photo of syed afroz

syed afroz

14y
1.5k
1
Hi !!!!!

i need to search for a string in a text file and at the same time i want store the perticular line containing search text into a string variable..

for eg..
i've line

1 abc technician
2 bbb new

if i search for 2 then it should go the line('2 bbb new ') and store entire line in a variable
How can i achieve this ????
 

Answers (1)