• Post Reply Bookmark Topic Watch Topic
  • New Topic

Letter y ruins my text processing  RSS feed

 
Greenhorn
Posts: 29
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I've written a program that inserts text into a doc file. This file is then read by some specialized software, which looks for certain tags when it opens the file. My program inserts the text without disturbing these tags. The program almost always works, but with some files it has been failing for some odd reason. Failing means the specialized software won't open the doc file after I process it with my program, giving an error message that the formatting is wrong.

For the last file that failed, I have narrowed the place of the failure down to a particular character. This phrase:
represented by Name
causes a failure (the file will not open in the specialized software), but if I take away the letter y and make it
represented b Name
the file will open in the specialized software.
If I change the phrase to
represented be Name
the file opens in the specialized software.

What is it with the letter y? I'm not expecting anyone to wade through my code, but is there some concept around text processing, characters..... that I don't know about?

Any ideas about this would be gratefully appreciated.
 
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's nothing special about the letter y. Since we don't know what this "specialized software" is that you mention, it's really hard to say anything about why it can't read your file.

With a "doc file", do you mean a Microsoft Word *.doc file? Microsoft Word files are formatted in a proprietary binary format. You can't easily replace some text in such a file and expect to still have a valid and correctly formatted word file. If you modify some part of a Word *.doc file without understanding the exact format of these files, then it might work if you're lucky, but there's a big chance that you corrupt the file.

I know of one Java library that lets you work with Microsoft Office files properly: Apache POI.
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please post the program ? Without it I doubt we can be of much help.

Also, the letter y may not be the problem, could it be that your texts contains hidden characters , and one of those is the problem ?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!