Hello, My current directory has several folders within it. Each folder has the same type of file within it. How do i go from the current directory, into one of the folders, edit the file, then come out of the folder, then go into another folder, edit a file then come out of the folder then into a new one etc etc etc. If this does not make sense i apologise and will try to explain my problem a little better. Any help would be much appreciated. Cheers, Phil
Phil: I'm not sure it makes sense. Personally I use the mouse and keyboard for doing this. Were you thinking of something else? Were you wanting to do some preset things from an m-file? If so, can't you just use cd, fullfile, fileparts, fopen, fscanf, textscan, and those sorts of things? Regards, ImageAnalyst
"Image Analyst" <firstname.lastname@example.org> wrote in message <email@example.com>... > Phil: > I'm not sure it makes sense. Personally I use the mouse and keyboard for doing this. Were you thinking of something else? Were you wanting to do some preset things from an m-file? If so, can't you just use cd, fullfile, fileparts, fopen, fscanf, textscan, and those sorts of things? > Regards, > ImageAnalyst What i mean is automatically cycle through the folders picking out the files, editing them, then picking another folder in the current directory, going into that folder, editing the file then moving onto the next folder within the current directory and editing that file and so on and so on until all the of the folders within the current directory have been edited. So i have: current directory = desktop\Upper Folder folders within current directory folder 1 = desktop\Upper Folder\Folder 1 folder 2 = desktop\Upper Folder\Folder 2 folder 3 = desktop\Upper Folder\Folder 3 Go into each folder, edit a file, come out of a folder then move onto the next. I hope this makes more sense. Any help would be great. Thanks, Phil
OK That makes sense. Use the Current Directory panel of MATLAB to select ("go into") your folders - use the mouse for this. Then double click on a filename that you want to edit (again, use the mouse). Then an edit panel will be created. Move the mouse cursor to the place where you want to make your edits. Now use the keyboard keys to actually make the edits. Finally, use the mouse to click on the disk icon on the toolbar to save your edits. Repeat as many times as necessary.
I guess the editing is automatical as well... for Low-Level File I/O Functions check out http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/matlab_prog/f5-84430.html if you know the names and path of the files, u just need to change the filename string in fopen
check this thread http://www.mathworks.com/matlabcentral/newsreader/view_thread/243461 its pretty much your same question, before posting, try to search the previous posts.