Hey guys I want some help over here!
I want to extract all values and exclude this value ‘-9999.000000’ from the text file!
another issue is it deals with the txt file as strings!
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as plt
skip_num = '-9999.000000'
skip_num2 = -9999.000000
file_path = "******\\Desktop\\Top1.txt"
with open(file_path, 'r') as file:
lines = file.readlines()
for line in lines:
if line == skip_num or line == skip_num2:
continue
print(line)
part of the text file for ex:
1691.536209 1692.370721 1693.039722 1693.561744 1693.973645 1694.314977
1694.618101 1694.896711 1695.131911 1695.272466 1695.279960 1695.158461
1694.952690 1694.742281 1694.632870 1694.696035 1694.924255 1695.240304
1695.556093 1695.778526 1695.844049 1695.750505 1695.560313 1695.330033
1695.103891 1694.913418 1694.788435 1694.711884 1694.665856 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
-9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000 -9999.000000
it is not excluding the values for some reason!! so i need your help