I am using strchr() to read a string from a file. The string consists of a filename followed by a '\t', followed by an integer. The returned string is prefixed with the search character; '\t'. I want to remove the tab from the subsequent returned string, while retaining the filesize integer. Any suggestions? Here is a snippet of the code:
if( (fh_IElist = fopen( ielist, "r" )) != NULL )
{
p_Line = fgets( iefile.p_fname, FILENAME_MAX, fh_IElist );
if( p_Line != NULL )
{
stat( iefile.p_fname, &buf );
printf( "%s%s \n", "File Name is: ", iefile.p_fname );
}
else if( p_Line == NULL )
{
printf( "Cannot fgets file \n" );
}
p_Fname = strchr( iefile.p_fname, '\t' );
printf( "%s%s", "Pointer to first occurance of tab is:", p_Fname );
}
Thanks in advance for help!!
if( (fh_IElist = fopen( ielist, "r" )) != NULL )
{
p_Line = fgets( iefile.p_fname, FILENAME_MAX, fh_IElist );
if( p_Line != NULL )
{
stat( iefile.p_fname, &buf );
printf( "%s%s \n", "File Name is: ", iefile.p_fname );
}
else if( p_Line == NULL )
{
printf( "Cannot fgets file \n" );
}
p_Fname = strchr( iefile.p_fname, '\t' );
printf( "%s%s", "Pointer to first occurance of tab is:", p_Fname );
}
Thanks in advance for help!!