-
Notifications
You must be signed in to change notification settings - Fork 7
Find or build tool to mine the header for metadata #5
Comments
+1 :) |
I'm looking into an implementation of this which is based on regex instead.
Notes: edit: Updated the below, based on the actual implementation I added a PR for
Details:
Possible improvements:
Other notes: |
@aleksandervines - very nice 👍 I was initially trying to avoid regular expressions, as the users I have been targeting do not necessarily understand what a regex is. However, I think with appropriate documentation with many examples, regex's could work for most users (and since it's optional, it's no big deal if they opt out of using them). I'll go ahead and merge this is as is, but will open another issue with the list of possible improvements your outline. Thank you! |
Design a way for users to automatically mine the header of their data file.
Some implementation thoughts...
Suppose the header contains:
Site ID: SNRP, Latitude 35.0N, Longitude 105.2 degrees_west
User could specify:
Station Name: "Site ID: [],"
Latitude: "Latitude []N,"
Latitude Units: "Latitude [-1],"
Longitude: "Longitude [] degrees_west"
Longitude Units: "Longitude [-12:]"
[] means grab all the stuff between the surrounding text (i.e. Latitude []N" means get the stuff between "Latitude" and "N")
[ind], or [start:stop] will grab the stuff between the strings, but index into that 'stuff'
[0] means first
[-1] means last index
[0:5] means indicies 0,1,2,3,4
[-12:] means 12th index from the end, to the end
The text was updated successfully, but these errors were encountered: