DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Macro for File Export

 
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions
View previous topic :: View next topic  
Author Message
dhousema



Joined: 01 Jun 2004
Posts: 2

PostPosted: Tue Jun 01, 2004 3:27 pm    Post subject: Macro for File Export Reply with quote

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
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Tue Jun 01, 2004 5:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
dhousema



Joined: 01 Jun 2004
Posts: 2

PostPosted: Wed Jun 02, 2004 6:57 am    Post subject: Thanx Reply with quote

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
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Wed Jun 02, 2004 8:50 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Suggestions/Questions All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group