: : : Hi ppl,
: : :
: : : My problem is i need to upload an excel or csv file into the server. Dat is working perfectly, but while uploading if the file consists of some non printable characters like \n,\r,\t , it should scrubb off these characters and upload it into the server. How to scrubb these values and send it to the server.
: : : I'm using Eclipse framework. Coding in java...
: : : Anbody can post the code here??
: : :
: : First the client should read the file and do a global replace to an empty substring of all the characters you don't want to include. Then it should write that data into a temporary file. Finally it can upload that file to the server, while giving it the original name.
: : Beware: In case of most files this will corrupt the file, making it unreadable by programs.
: I tried everything dat is possible and to my knowledge, but i'm not able to resolve this issue. Can anyone help me with the code? How to find the \n,\r characters in the excel file?? Clarify
The code is dependant on the storage of the file. For a string you can use the String.indexOf(string, int) or String.replace(char, char) method. For an array of bytes/char you need to use a for-loop to loop through all the elements. A Collection<Character> based storage can use the "foreach"-statement.