Click here to Skip to main content
15,868,127 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have a pcl file. I want to remove a line of data from pcl file. I don't have pcl line of data but i have normal text and my text is "c40Ec45Ec46Ec107Ec125Ec35Ec40Ec45Ec46Ec50Ec60Ec125Ec35Ec40Ec50E*c88E".

I want to remove this line of code from pcl file.


What I have tried:

i tried to to get start index and end index of the string and tried to find it but it doesn't appear in the PCL. PCL is command line so i need to know how to strip out this line of code
Posted
Updated 30-Sep-19 10:43am
Comments
RickZeeland 30-Sep-19 13:31pm    
So if I understand correctly you want to do this with DOS commands or Powershell ?
Richard MacCutchan 30-Sep-19 14:32pm    
Use notepad.
RickZeeland 30-Sep-19 14:56pm    
++

Try this:
powershell -Command "(gc PclFile.pcl) -replace 'c40Ec45Ec46Ec107Ec125Ec35Ec40Ec45Ec46Ec50Ec60Ec125Ec35Ec40Ec50E*c88E', '' | Out-File -encoding ASCII PclFile.pcl"
Also see: Replace() - PowerShell - SS64.com[^]

Information about the PCL File Extension - Open .PCL File (Printer Control Language file)[^]
 
Share this answer
 
v3
Comments
Maciej Los 1-Oct-19 6:09am    
5ed!
Member 11183856 1-Oct-19 6:25am    
hi,

i have used the below command in the power shell command prompt

"(gc G:\Projects\SampleOutput\SUPPORT.pcl) -replace '*c40E*c45Ec46E*c107E*c125E*c35Ec40E*c45E*c46E*c50E*c60E*c125Ec35E*c40E*c50E*c88E','' | Out-File -encoding ASCII G:\Projects\SampleOutput\a.pcl"


a.pcl is not generated.
Member 11183856 1-Oct-19 12:06pm    
what is "gc" in the above code. I want to do it in command line.

I'm using ghostpcl to convert pcl to pdf.
RickZeeland 1-Oct-19 12:13pm    
GC is shorthand for Get-Content, see: https://ss64.com/ps/replace.html
Quote:
I have a pcl file. I want to remove a line of data from pcl file.

Generally, a pcl file is a file containing a dump of HP-PCL (Printer Command Language) commands for a printer that understand it.
Quote:
i tried to to get start index and end index of the string and tried to find it but it doesn't appear in the PCL.

It is not a flat text file, char to be printed are interleaved with commands and some times replaced by a bitmap matrix of the shape of the char to print.
So it is no wonder you don't find your string.
I recommend to use programmer's editor that is capable of binary display mode as the pcl include non printable chars.
Notepad++ Home[^]
ultraedit[^]
When I play surgeon with such a file, I use UltraEdit.

Not much more help can be provided without the file it self.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900