i have a table structure with 25 fields (all chars) and need to print them in a text format (csv). i need to check each and every field data for null ('\0') and also delete their trailing spaces. i tried using the for statement: for(x=0;x<(strlen(fld));x++) format but my code got so long because i kept repeating this statement and not exactly sure how to pass variables. i'm writing this in SCO V platform. could somebody please tell me how to make this work the easiest and simplest way possible. some field data could have 3 or more words in it (like city) and i have to capture every character in it. i really appreciate any help. thanks.