Danny Huber
Danny Huber

Reputation: 21

Opening and Reading clipper header (.CH) data file with python 3.7

I am relatively new to python and am not even sure if this is at all possible as clipper header files are written entirely in C to my limited knowledge. I am hoping someone might have some idea of how to open a .CH file such as '''ECD1B.CH''' Below is how the file is being opened:

    CH_File = glob.glob(folderView + "**/*.CH", recursive = True)
    CH_File2 = CH_File[0]
    print (CH_File2)
    CH_Opened = open(CH_File2, 'r')
    print (CH_Opened)

The following opened file that python prints is:

<_io.TextIOWrapper name='C:\Users\342232\Documents\MATLAB\10OCT19 Data Folders BHP\20SEPS36.D\ECD1B.CH' mode='r' encoding='cp1252'>

Clearly, python was unable to print the actual content embedded in the file. I am wondering if this is even possible to open in python. I do have a friend that wrote code in Matlab that can open this file type. Open to any suggestions and thank you in advance.

Upvotes: 1

Views: 508

Answers (0)

Related Questions