csv is already memorized, so, we think, which is placing error.
How do we inspect the ideal result and the result wrong in memories?
We have to create the ideal answer in a file and check if the result matches or not
1 |
replace.cpp Sun Mar 14 18:53:16 2021 ... 163 :int replace_csv ( char* form_file ) { 164 : char str_num[10]; 165 : char* string; 166 : printf("replace_csv starts.\r\n"); 167 : sleep(1); 168 : // if we read a file all, memorization is changed wrong. 169 : string = read_all(form_file); 170 : 171 : for( int i =0; i<3; i++ ) { 172 : for( int j =0; j<3; j++ ) { 173 : sprintf( str_num, "$%d%d", i, j ); 174 :// printf("i %d j %d {%p} |%s|: ", i, j, csv[i][j], (char*)csv[i][j]); 175 : if ( csv[i][j] != nullptr ) 176 : string = m_replace ( string, str_num, csv[i][j] ); 177 : 178 : printf("replace: %d %d |%s|%s|:\r\n|%s|\r\n", i, j, str_num, csv[i][j], string); 179 : sleep(1); 180 : } 181 : } 182 : 183 :// write_block( ".\\001-html-20210211-001\.txt", string ); 184 : printf("replace_csv ends.\r\n"); 185 : return -1; 186 :} |
||
2 | |||