01-07-2009
awk ' NF > 0 ' test.txt >tmp.txt : remove the blank lines
awk '{ print NR ": " substr($0, length($0)-1) }' tmp.txt
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
using c-shell, does anyone know how to send control characters to the printer before the job?
I need to set a printer to print in condensed mode
HELP (1 Reply)
Discussion started by: mglinsk
1 Replies
2. Shell Programming and Scripting
I am trying to edit a syslinux msg file. I want to precede color codes with control characters. I have tried insert mode, then control v followed by the color code; however, I continue to get " [O " if I type the color code or enter ESC mode. How can I just insert say " ^L " ? (2 Replies)
Discussion started by: cstovall
2 Replies
3. UNIX for Dummies Questions & Answers
Hi there,
I want to open a cash drawer remotely. The cash drawer is commanded by a printer.
I need to connect to the cash drawer which is connected over a network (and shared) and simply send a sequence of five ASCII commands (see http://pages.prodigy.net/daleharris/popopen2.htm) to a... (5 Replies)
Discussion started by: Friğrik
5 Replies
4. UNIX for Dummies Questions & Answers
Hi
I have a password stored in a file (which is a user input)
The password is having the special character $
say the password is pw$ord and is stored in the file pw_note
I am using the following statement to store the passowrd in a
variable
$schema_pwd = `cat $dir/pwd_note` ;
Now if i print... (4 Replies)
Discussion started by: ssuresh1999
4 Replies
5. Linux
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
6. Shell Programming and Scripting
Hi,
I am trying to get an output like :
+----------------------------------+ ----------- +
+ some variable substitution + some text +
Is there a way I can specify in printf (in ksh) the particular position I want to print a character, and also repeat a character from... (1 Reply)
Discussion started by: neil.k
1 Replies
7. Shell Programming and Scripting
Hi Experts,
I want to print this charts diagonal data into straight lines.
This is a matrix 24X24 Horizontal and vertical.
- I want to print all the diagonal cutting characters into straight line:
Data:
E F S S A H A L L A T M C N O T S O B O D U Q H
I W I B N L O C N I L N L A N S I N... (9 Replies)
Discussion started by: rveri
9 Replies
8. Shell Programming and Scripting
Dear All,
fileName: therm.txt
nc3h7o2h 7/27/98 thermc 3h 8o 2 0g 300.000 5000.000 1390.000 41
1.47017550e+01 1.71731699e-02-5.91205329e-06 9.21842570e-10-5.36438880e-14 2
-2.99988556e+04-4.93387892e+01 2.34710908e+00 4.34517484e-02-2.65357553e-05 3
... (7 Replies)
Discussion started by: linuxUser_
7 Replies
9. Shell Programming and Scripting
How do I remove the printer escape sequence, the first 5 characters, that occurs on every 33rd line in a file, see hex dump of line 1.
0000 1e 00 00 00 00 0a 0a 0a 20 0a 20 20 20 20 20 20 ....
0010 20 20 20 20 20 20 20 20 20 20 0a 42 49 4c 4c 20
Thanks, (2 Replies)
Discussion started by: jgt
2 Replies
10. Shell Programming and Scripting
My file (the output of an experiment) starts off looking like this,
_____________________________________________________________
Subjects incorporated to date: 001
Data file started on machine PKSHS260-05CP
**********************************************************************
Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
hp(1) General Commands Manual hp(1)
NAME
hp - handle special functions of HP2640 and HP2621-series terminals
SYNOPSIS
DESCRIPTION
supports special functions of the Hewlett-Packard HP 2640 and HP 2621 series of terminals, with the primary purpose of producing accurate
representations of most output. A typical use is:
Regardless of the hardware options on a given terminal, tries to do sensible things with underlining and reverse line-feeds. If the termi-
nal has the ``display enhancements'' feature, subscripts and superscripts can be indicated in distinct ways. If it has the ``mathematical-
symbol'' feature, Greek and other special characters can be displayed.
Options
recognizes the following options:
Specify that your terminal has the ``display enhancements'' feature,
to make maximal use of the added display modes. Overstruck characters are presented in the Underline mode. Superscripts
are shown in Half-bright mode, and subscripts in Half-bright, Underlined mode. If this flag is omitted, assumes that your
terminal lacks the ``display enhancements'' feature. In this case, all overstruck characters, subscripts, and super-
scripts are displayed in Inverse Video mode; that is, dark-on-light, rather than light-on-dark.
Request minimization of output by removing new-lines.
Any contiguous sequence of 3 or more new-lines is converted into a sequence of only 2 new-lines; that is, any number of
successive blank lines produces only a single blank output line. This allows you to retain more actual text on the
screen.
DIAGNOSTICS
The representation of a line exceeds 1,024 characters.
RETURN VALUE
returns zero for normal termination, and 2 for all errors.
WARNINGS
An ``overstriking sequence'' is defined as a printing character followed by a backspace followed by another printing character. In such
sequences, if either printing character is an underscore, the other printing character is shown underlined or in Inverse Video; otherwise,
only the first printing character is shown (again, underlined or in Inverse Video). Nothing special is done if a backspace is adjacent to
an ASCII control character. Sequences of control characters (e.g., reverse line-feeds, backspaces) can make text ``disappear''; in partic-
ular, tables generated by that contain vertical lines will often be missing the lines of text that contain the ``foot'' of a vertical line,
unless the input to is piped through (see col(1)).
Although some terminals do support numerical superscript characters, no attempt is made to display them.
SEE ALSO
col(1), neqn(1), nroff(1), tbl(1).
hp(1)