Dynamic naming of output .txt and/or numerical arrays
1 view (last 30 days)
Show older comments
Okay, before I begin my question, let me clearly state what this question is NOT. This question is not asking on how to dynamically name variables or calculation variables within my script, I know that is a very bad thing and can really muck things up.
So, my question is, what is the best way to go about setting up a script that will read in a file from multiple sources that will be of many different lengths and contatin data from mulltiple sites that use multple different names. The information in each row has the "site id" in the first column which will be used to create an output .txt file to parse and save the data for later use.
I have a static version of this script and it will tear through 10K files in about 3 min and put all the data for 24 different .txt files named by their "site id" in a nice orderly set for later analysis by a different script. Each variable is named carefully to make sure this happens with no errors. This works for one AOR but I now need to look at other AORs and each AOR has a different number of uniquely named sites (this is important as this identifies the geographic location and this information needs to be perserved). So I need a way to name my output and temporay arrays dynamically so that I can read in any AOR but still get the resolution and fidelity that I currenty get with my "fixed name and length" script. I don't like the idea of creating 62 different ingest files. Not fun.
Any suggestions?
2 Comments
James Tursa
on 6 Apr 2020
Can you give us a short example of the file(s) and what you would like as a result? Or describe your desired process in pseudo-code?
Answers (0)
See Also
Categories
Find more on HDF5 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!