View previous topic :: View next topic |
Author |
Message |
dhousema
Joined: 01 Jun 2004 Posts: 2
|
Posted: Tue Jun 01, 2004 3:27 pm Post subject: Macro for File Export |
|
|
Hi,
I have seen in the help how to batch export files to another format, but I'm having some trouble.
I'm trying to export a bunch of nicolet data files that are in subdirectories
such as C:\test\1Jun2004\ch 0\test??\*.wft
I would like to batch export them to a csv files.
Please help
Thank you
dustin
dustin.houseman@atc.army.mil |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2311 Location: Vicksburg, Mississippi
|
Posted: Tue Jun 01, 2004 5:34 pm Post subject: |
|
|
You can't do exactly what you want, but you can come pretty close:
Directory("C:\test\1Jun2004\ch 0")
ForFilesIn("test??\*.wft")
FileSaveAs(2,".csv")
FileClose()
NextFile
This will save the first curve (and only the first) to the same filename with .csv extension. But the file will contain an extra number (the number of points) in the first line.
I'll add support for .csv files (w/o the number of points) to FileSaveAs in the next release. Like the above it will most likely be limited to saving only the first curve. Or I'll add another parameter to save all curves if all curves have the same number of points, same spacing, etc. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
dhousema
Joined: 01 Jun 2004 Posts: 2
|
Posted: Wed Jun 02, 2004 6:57 am Post subject: Thanx |
|
|
Thank you for the help.
It didn't exactly work how I planned however. The test?? is an individual directory such as test 01, test 02, etc etc. The macro editor seemed to lock up on my machine.
I just edited the macro 15 times or so. and that seemed to work. It would be nice if it could traverse the subdirectories and convert them.
Directory("C:\test\1Jun2004\ch 0\test 15")
ForFilesIn("*.wft")
FileSaveAs(2,".csv")
FileClose()
NextFile |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2311 Location: Vicksburg, Mississippi
|
Posted: Wed Jun 02, 2004 8:50 am Post subject: |
|
|
Ack! Sorry, I was on autopilot when I typed that and it didn't register that your ?? was part of the folder rather than the filename. As you found, that won't work.
Quote: | It would be nice if it could traverse the subdirectories and convert them. |
Yes it would. I'll see what I can do. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
|