I have these files that contain a name in the first line I wish to extract. All the methods I have approach either result in error or give me nothing.
An example file can be found here: https://www.dropbox.com/s/0kcgj8vr3wii33s/FORS2.2011-10-23T23_59_20.355_out.fits?dl=0
I wish to extract "PN-G013.3+01.1", which lies on the first line (column 2091 in this case, the name is unique to each file) and is classed as "OBJECT".
Thank you in advance!
Peter
I suspect you have problems with it because it has Unix line endings instead of DOS style line endings.
This appears to work, but it's a bit brittle - tied to the position of the contents of the example you linked:
If it's always a 14 character name field, you can skip the last for loop and try: