Maddening text sorting problem

P

pkirk25

Bolt of Silk Cloth
Bolt of Wool Cloth
Bolt of Silk Cloth
Bolt of Wool Cloth

To my untrained eye, these are 2 duplicate lines. But to my compiler,
to Microsoft Access and Excel they are 4 unique lines.

"Bolt of" finds all 4.
"Bolt of S" finds one.

The original document had lots of 'ÿ' instead of ' ' so I wonder if
thats connected?

I have the feeling of not seeing wood for trees. Anyone know what
might cause such wierdness?
 
A

Ancient_Hacker

pkirk25 said:
Bolt of Silk Cloth
Bolt of Wool Cloth
Bolt of Silk Cloth
Bolt of Wool Cloth

To my untrained eye, these are 2 duplicate lines. But to my compiler,
to Microsoft Access and Excel they are 4 unique lines.

"Bolt of" finds all 4.
"Bolt of S" finds one.

try: C:> debug badfile.txt
- d 100

look the file over, maybe one of the spaces is a tab or non-breaking
space or other funny control character.
 
R

Richard Heathfield

pkirk25 said:
Bolt of Silk Cloth
Bolt of Wool Cloth
Bolt of Silk Cloth
Bolt of Wool Cloth

To my untrained eye, these are 2 duplicate lines. But to my compiler,
to Microsoft Access and Excel they are 4 unique lines.

What you've posted is two sets of two lines, the second set being an exact
copy of the first. What you've posted may not be what you showed Access or
Excel.
The original document had lots of 'ÿ' instead of ' ' so I wonder if
thats connected?

Cooooouuuuuuld beeee! :)

You're probably dragging along some formatting junk for the ride, which gets
filtered out in a text format such as Usenet. Just a guess.
 
P

pkirk25

Exported to text file with "<br>\n" ending each line, opened in
Firefox, copied and pasted and my sorting routine worked.
 
R

Richard Heathfield

pkirk25 said:
Exported to text file with "<br>\n" ending each line, opened in
Firefox, copied and pasted and my sorting routine worked.

Useful exercise for you:

Write a C program to convert each character in a stream of "text" (or
whatever) to hexadecimal representation. (You may find the printf format
string " %02X" useful.)
 
M

Michael Mair

Richard said:
pkirk25 said:


Useful exercise for you:

Write a C program to convert each character in a stream of "text" (or
whatever) to hexadecimal representation. (You may find the printf format
string " %02X" useful.)

If we are in pedantic mode,
" %0*X"
with '(CHAR_BIT + 3)/4' supplied for the '*' field width or
an appropriate macro version :)

Cheers
Michael
 
J

jmcgill

pkirk25 said:
Exported to text file with "<br>\n" ending each line, opened in
Firefox, copied and pasted and my sorting routine worked.

What in the world are you talking about? I'm pretty sure this is about
some text markup language and not the C Programming Language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top