Python read .txt-files header -
i need read information txt file header looks this:
date 20160122 sp number 8 gauge 250n internal total height 61 sp modell sp2 corner distance 150 height value comment 60 nan ...
i have python program program doing this:
depth, n = npy.loadtxt(filename, skiprows=8, unpack=true, usecols = usecols)
however read out of values header. there way this? interested value of "total height". on search seem find answers concerning .csv files.
i use open
rather npy.loadtxt
with open(filename, 'r') the_file: all_data = [line.strip() line in the_file.readlines()] height_line = all_data[3] data = all_data[8:]
then can parse value of height_line
, total height. , data file in variable data
.
Comments
Post a Comment