Question

I confess I'm having a really bad time here.

I have a C program that reads a txt file and uploads to a database.

It works fine if you enter data directly into TextEdit. It does not work fine if you create data in Microsoft Word and copy it across. The major issue is how the newline works, although the MySQL calls get messed up too because of hidden characters.

I've been mucking about with hex checks and \r but there is chaos data in there. When I print a hex dump, the terminal output does predictably crazy things like jumping back a line, overwriting characters that have already been printed, and so on. I've been using isprint( to try and eliminate the hidden characters, but something is getting through anyway.

So... is there a way to get a "clean" copy of the data from Word into TextEdit?

Was it helpful?

Solution

You can use a Hex Editor to firstly look at the extra character's that are present in the files. On the basis of that you can think something what should be there and what are the arbitrary things that u do not want. Later you can also try some options in the Text edit also to disable the Extra characters.Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top