Home > marsbar > @mardo_5 > private > pr_spm_fileparts.m

pr_spm_fileparts

PURPOSE ^

Like fileparts, but separates off a comma separated list at the end

SYNOPSIS ^

function [pth,nam,ext,num] = spm_fileparts(fname)

DESCRIPTION ^

 Like fileparts, but separates off a comma separated list at the end
 FORMAT [pth,nam,ext,num] = spm_fileparts(fname)
 fname - original filename
 pth   - path
 nam   - filename
 ext   - extension
 num   - comma separated list of values

_______________________________________________________________________
 Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [pth,nam,ext,num] = spm_fileparts(fname)
0002 % Like fileparts, but separates off a comma separated list at the end
0003 % FORMAT [pth,nam,ext,num] = spm_fileparts(fname)
0004 % fname - original filename
0005 % pth   - path
0006 % nam   - filename
0007 % ext   - extension
0008 % num   - comma separated list of values
0009 %
0010 %_______________________________________________________________________
0011 % Copyright (C) 2005 Wellcome Department of Imaging Neuroscience
0012 
0013 % John Ashburner
0014 % $Id: spm_fileparts.m 112 2005-05-04 18:20:52Z john $
0015 
0016 
0017 num = '';
0018 [pth,nam,ext] = fileparts(fname);
0019 ind = find(ext==',');
0020 if ~isempty(ind),
0021     num = ext(ind(1):end);
0022     ext = ext(1:(ind(1)-1));
0023 end;
0024 

Generated on Wed 11-May-2022 16:26:09 by m2html © 2003-2019