comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Counting header lines in a file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Counting header lines in a file [message #94623 is a reply to message #94605] Wed, 26 July 2017 05:59 Go to previous messageGo to previous message
Matthew Argall is currently offline  Matthew Argall
Messages: 286
Registered: October 2011
Senior Member
Here is how I solved this problem.
https://github.com/argallmr/IDLlib/blob/master/file_utils/mr file_read_ascii.pro

At the top, there is a helper function called "MrFile_Read_Ascii_Header". It reads each line of the file 1-by-1 until it has read five consecutive lines with the same number of columns. All lines with mismatched number of columns are considered the header. Additionally, the first line of data is parsed to determine its formatting. The output can then be passed to Read_Ascii in the form of a template.

The main program, "MrFile_Read_Ascii", is a wrapper for the Ascii_Template and Read_Ascii procedures and is based off of a program from Mike Galloy.

Hope this helps
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Polar_contour question
Next Topic: error with cgPS_Close Program

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:49:39 PDT 2025

Total time taken to generate the page: 0.00401 seconds