I have a txt file made like this:
2,5,25,6
3,5,78,6,
5,23,24,85
6,4,79,9
69,23,12,51
I should extract only two values that are the first value in the first line 2 and the first value in the last line 69. The program I wrote is the following:
with open("C:\values.txt", "r") as fp:
lines = fp.readlines()
for i in range(0, len(lines)):
print(lines[i])
but I can only print all the lines present in the txt file.