[Tutor] Trouble using bioread to convert files from .acq to .mat

Alan Gauld alan.gauld at btinternet.com
Wed Jun 3 18:18:06 CEST 2015


On 03/06/15 13:57, Ila Kumar wrote:

> However, now I am confused about what I need to type into the Command
> prompt window (on a 64-bit windows computer, using python 2.7) in order to
> convert a folder of data files. Does anyone know the proper code to do this?

You will need to give us a lot more detail than that to help you.
Convert what kind of data file? To what kind of output file?

Also for most such tasks you won;t be typing it at the prompt
you will be writing a script and executing that. Do you have any 
experience of Python scripting/programming? If not  you should find a 
tutorial and follow that. If you know how to program in another language 
then the official web site tutorial should be just fine.

If you are a complete beginner to programming try one of these:

https://wiki.python.org/moin/BeginnersGuide/NonProgrammers

Or try mine (see link below)...

The code you need could be as simple as

#################
import os

def convertFile(fname):
    # your code to do the conversion goes here

dir = /your/folder/path/here
for fileName in os.listdir(dir):
     convertFile(fileName)

##################

But if there are subfolders to consider, or errors to
handle, then it all gets more messy quite quickly.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list