file = open("Test2.txt") do file
f = readlines(file)
for line in f
if line[23:28]== "Window"
open("t.txt","w") do file
write(file,line)
end
end
end
end
I tried what I was advised to do in the posts above but I didn’t succeed. So I tried a simpler syntax for me (probably less efficient).
My problem is that only the last line containing “Window” from the first file is written to the new file.
For example, with the file preview in my first post I get this :
out=open("t.txt","w")
file = open("Test2.txt") do file
f = readlines(file)
for line in f
if line[23:28]== "Window"
write(out,line)
write(out,"\n")
end
end
end
close(out)