Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modifying pcl file

Status
Not open for further replies.

CoBu

Programmer
Jan 14, 2009
7
Hi

What i am trying to achieve is to open a pcl file in a perl script find certain text, set as variable and replace another string with this variable. Works fine so far as all the find replace is working.

The only problem is that when i write out to the same pcl file there is a slight difference between the input file and the output file, so the printout is wrong and contains rogue characters.

Anybody have any suggestions as how to fix this issue?
I appreciate you taking the time to have a think!
 
My guess would be that the editing process needs to be put into a binary mode or something.

But really, you first need to save a copy of the file, process it and then compare the two files very closely and just see the exact differences.

Is the new file larger or smaller that can't be accounted for by actions in you Perl script.

Unix?

Jim Asman
 
The difference between the two files is minimal, it may be just that a string in the middle of a line is two tabs more to the right.. just frustrating things like that.

The files are exactly the same size.
 
Often, an editor will replace spaces with tabs or tabs with spaces according to its interpretation of tab positions.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top