I have code that reads lines from a txt file and then adds to the database.
If you enter data directly into a txt file, this is enough to recognize a new line: if (ch == '\n')
However, if you cut and paste Microsoft Word, the check for \ndoes not work.
If I unload the hexadecimal values / characters one by one, the actual data looks like this:
2e . [ Last char of line ]
d
58 X [ First char on next line ]
A full stop is the last character on one line. "X" is the first character on the next line. Hexadecimal 'd' calls a new line.
What's happening? And how can I test my variable chfor > d<, given that this is a space-d in hexadecimal format?
Thank.
source
share