Sponsored Content
Top Forums Shell Programming and Scripting Remove non printing characters from file Post 302976368 by jgt on Tuesday 28th of June 2016 05:03:48 PM
Old 06-28-2016
The print file has a reset to 10 cpi at the beginning of every page.
Previously we were using smbclient with "translate -c" to convert the file from unix to dos, but when we changed to use netcat, it seems that the nulls are causing the record to be dropped.
I have tried variations of
Code:
s/\0031\0000//

with sed and vi to no avail.
What I would like is something like:
Code:
sed -f sed.inp <$file |netcat -h 192.168.1.1 -p 9100

---------- Post updated at 05:03 PM ---------- Previous update was at 04:49 PM ----------

figured it out.
Code:
tr -d "\036\000" <input >output

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to remove null characters from file?

I'm trying to remove the null characters from a file and copy it to std output. I'm using emacs and I create the following one line bash file (followed by the error messages): sed -e 's/^@//' <ConfigItemReplicator.install.log /usr/bin/bash: -c: line 0: unexpected EOF while looking for... (1 Reply)
Discussion started by: siegfried
1 Replies

2. Shell Programming and Scripting

Remove characters from file name

Here is my code. for file in *1.3.html ; do mv "$file" `echo $file | tr '.1.3' ''` ; done For some reason I am getting an error. mv: file.idlesince.1.3.html and file.idlesince.1.3.html are identical Could this be done a different way? (5 Replies)
Discussion started by: mrlayance
5 Replies

3. Shell Programming and Scripting

Trying to remove '^M' characters from a file.

Hi guys, Hope you are all well. This is a line of data from a csv file. I have used vi and set the 'set list' option to display the trailing $ character. "01","Grocery","01006","eat Fish & Spreads"$ I have tried the following commands, but neither of them appear to be working? 1) tr... (13 Replies)
Discussion started by: Krispy
13 Replies

4. Shell Programming and Scripting

How to remove ^M characters from a zip file?

Hi All, As all of us know that while moving a file from Windows to Unix some unwanted ^M characters appear in the file. For my case I have release package in zip format which looks like Module_Name_Tag.zip. It contains some directory structure...like Module_Name_Tag.zip | |--trunk/... (2 Replies)
Discussion started by: bhaskar_m
2 Replies

5. Shell Programming and Scripting

Remove the characters from the file

Hi, I have one file in the following format. exa_resu_adj.4ge v.47645 PERSONAL INFORMAIONS PVT LTD 31 Dec 2009 04:36 Page 1 SALARY REPORT Account Account Name CCode Bill No Balance T Amt ----------- ------------ ------- ---------- ------------- ------------- 17490001 Mr Ram PM 10... (6 Replies)
Discussion started by: Kattoor
6 Replies

6. Linux

Removing non printing characters from a csv file

Hi, I have an csv file and there are some non printable characters(extended ascii) so I am trying to create a clean copy of the csv file . I am using this command: tr -cd "" < /opt/informatica/PowerCenter8.6.0/server/infa_shared/SrcFiles/ThirdParty/locations.csv > ... (4 Replies)
Discussion started by: gerkus
4 Replies

7. UNIX Desktop Questions & Answers

Remove new line characters from a file

I tried using below command tr -cd "" < InputFile.xml > output.txt ============= This removes all the tabs/newline/extra spaces from a file it successfully removed all the extra spaces,tabs and new line characters but then the complete file become one record. I want to retain one new line... (1 Reply)
Discussion started by: saini
1 Replies

8. Shell Programming and Scripting

Remove characters from fixed length file

Hello I've question on the requirement I am working on. We are getting a fixed length file with "33" characters long. We are processing that file loading into DB. Now some times we are getting a file with "35" characters long. In this case I have to remove two characters (in 22,23... (14 Replies)
Discussion started by: manasvi24
14 Replies

9. Shell Programming and Scripting

Remove characters from the file

i know , the below question has been repeated. can you guys guide me . I have the below input 999999 xxxxxxxxxxxxxx 123.45 2013-05-02 08:14 1 1 1 xxxx 999999 xxxxxxxxxxxxxx 123.45 2013-06-02 02:14 1 4 1 dddd i need to remove from the column 54 to 70 , as like the below output.... (9 Replies)
Discussion started by: expert
9 Replies

10. Shell Programming and Scripting

I want to remove 1st and last two characters of each line of the file

I want to remove 1st and last two characters of each line of the file Ex: file1 zzfile1ee @xfile2:y qfile3>> @ file4yy and redirect to the file called new Basically file will have any charcter including space, spical character... Please help.... (7 Replies)
Discussion started by: shell1509
7 Replies
rcancel(1M)															       rcancel(1M)

NAME
rcancel - remove requests from a remote printer spooling queue SYNOPSIS
[id ...] [printer] user] DESCRIPTION
The command removes a request, or requests, from the spool queue of a remote printer. is invoked by the command (see lp(1)). At least one id or the name of a printer must be specified. This command is intended to be used only by the spool system in response to the command (see lp(1)), and should not be invoked directly. Options The command recognizes the following options: id Specifying a request ID (as returned by (see lp(1))) cancels the associated request, even if it is currently printing. The maximum number of ids that can be specified is 50. printer Name of the printer (for a complete list, use (see lpstat(1))). Specifying a printer cancels the request which is cur- rently printing on that printer, if the request is owned by the user. If the or the option is specified, this option only specifies the printer on which to perform the corresponding cancel operation. Remove all requests owned by the user on the specified printer (see printer). The owner is determined by the user's login name and host name on the machine where the command was invoked. Empty the spool queue of all requests for the specified printer. This form of invoking is useful only to users with appropriate privileges. Remove any requests queued belonging to that user (or users) for the specified printer. You can repeat the option to specify more users. The maximum number of users that can be specified is 50. This form of invoking is useful only to users with appropriate privileges. WARNINGS
A remote print request can be canceled only from the system on which the the original command was issued, and if the restrict cancel fea- ture (see lpadmin(1M)) is enabled for the specified printer, a request belonging to this printer can be canceled only by the system admin- istrator or the user who requested it. This command is intended to be used only by the spool system in response to the command (see lp(1)), and should not be invoked directly. AUTHOR
was developed by the University of California, Berkeley, and HP. FILES
SEE ALSO
enable(1), lp(1), lpstat(1), accept(1M), lpadmin(1M), lpsched(1M), rlp(1M), rlpdaemon(1M), rlpstat(1M). rcancel(1M)
All times are GMT -4. The time now is 09:35 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy