03-16-2009 09:39 PM
I have this c:\test\basic\testfile.xls
and I want testfile.xls extracted string.
I did it the hard way and wrote my own function
void ConvertFilename( char *path, int count)
char tmp[MAX_FILE_CHAR];
int found =0,i=0,j=0;
for (i=0; i < count; i++)
{
tmp[i]= (( char ) *path++ );
if ( tmp[i] == '\\' ) found = i;
}
for (j=found; j < count; j++) *(path ++) = tmp[j];
*(path ++) = 0;
Is there an easier way in CVI?
Thanks
03-17-2009 12:38 AM
03-17-2009 02:52 AM
03-17-2009 03:15 AM
Or you could also just use the C string manipulation basics:
char *lastSep= strrchr(path, '\\');
return lastSep ? ++lastSep : path;
Mert A.
National Instruments
03-17-2009 09:42 AM
03-17-2009 09:50 AM
Markus, excellent suggestion, works great !!
Thank U all
Diego