06-01-2009
Yes, but you also have a '1' there, so you are printing every line. You need to delete that too, any you do nothing in the for loop/if statement.
Just check the field number in the for lop and print out the lines you want.
10 More Discussions You Might Find Interesting
1. UNIX Desktop Questions & Answers
How do I replace a tab with a space in scripts using sed/awk ? (1 Reply)
Discussion started by: avnerht
1 Replies
2. Shell Programming and Scripting
I've tried this:
echo "${bold}User${norm} : u"\t"${bold}All Users ${norm} : a\t"
and i got this output:
Specific User : u\tAll User: a\t (14 Replies)
Discussion started by: laila63
14 Replies
3. Shell Programming and Scripting
i have a commad that display the total each directory size in KB.Below the commad and o/p:
ls -ltr | grep ^d | awk '{print $9}' | xargs du -sk
output:
what i want is the proper tab space b/w value and dir.? how to get that.
thanks in advance (10 Replies)
Discussion started by: ali560045
10 Replies
4. UNIX for Dummies Questions & Answers
Hello,
Is there a direct command to check if the delimiter in your file is a tab or a space? And how can they be converted from one to another.
Thanks,
G (4 Replies)
Discussion started by: Gussifinknottle
4 Replies
5. Shell Programming and Scripting
Hi All,
Sample records
2157 91128 -rw-r----- 1 arun1 staff 93315072 Aug 23 06:44 /home/arun/my own/file_name.txt
2157 91128 -rw-r----- 1 arun1 staff 93315072 Aug 23 06:44 /home/arun/myown/file name2.txt
i want to print only user name, user group, size, date time stamp, and... (5 Replies)
Discussion started by: Arunprasad
5 Replies
6. Shell Programming and Scripting
Hi, I want to read lines from a file, and I'm using two methods
1 use
while read line
do
done<filename
2 use
line=`sed -n '3p' filename`
however, in both of them, I notice that the tab between fields are automatically converted to space
because I want to use awk over the... (10 Replies)
Discussion started by: esolvepolito
10 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have a space delimited text file but I only want to change the first space to a tab and keep the rest of the spaces intact. How do I go about doing that? Thanks! (3 Replies)
Discussion started by: evelibertine
3 Replies
8. Shell Programming and Scripting
I have a variable sumOfJEOutputFile which is the output file of an SQL command which contains the output of that SQL. The output looks like below:
-----------
58
I am using following code to manipulate the output:
(sed 1,2d $sumOfJEOutputFile > $newTemp1 | sed '$d' $newTemp1)... (4 Replies)
Discussion started by: Sharma331
4 Replies
9. Shell Programming and Scripting
In the below awk the output is space delimited, but it should be tab delimited. Did I not add the correct -F and OFS? Thank you :).
The input file are rather large so I did not include them, but they are tab-delimeted files as well.
awk
awk -F'\t' -v OFS='\t' 'FNR==1 { next }
> ... (2 Replies)
Discussion started by: cmccabe
2 Replies
10. UNIX for Beginners Questions & Answers
My file looks like
3 33 210.01.10.0 2.1 1211 560 26 45 1298 98763451112 15412323499 INPUT OK
3 233 40.01.10.0 2.1 1451 780 54 99 1876 78787878784 15423210199 CANCEL OK
Aim is to replace the spaces in each line by tab
Used: sed -e 's/ */\t/g'
But I get output like this... (3 Replies)
Discussion started by: sa@@
3 Replies
LEARN ABOUT OSF1
thailpof
thailpof(8) System Manager's Manual thailpof(8)
NAME
thailpof - Generic filter for printing Thai text files
SYNOPSIS
/usr/lbin/thailpof [-c] [-h host] [-H] [-i indent] [-l length] [-n login] [-P printer_id] [-S] [-w width] [accounting_file]
OPTIONS
Prints control characters. Specifies the host name of the job owner. This name can contain Thai characters. Enables half-height printing
mode. In printers without a one-pass printing mode, Thai characters are printed on 3 levels, or 3 lines. When half-height printing mode
is enabled, the 3 levels are printed in 1.5 lines, which improves the appearance of output. The cost of this improvement is slower print-
ing speed. Specifies the amount of indentation. The default value is no (no indentation). Specifies the page length in lines. The default
value is 22. Specifies the login name of the job owner. This name can contain Thai characters. Specifies the printer ID in the format
that conforms to the Wototo Specification. This format is [bb][mm][nn] where: Is the brand ID, representing the brand of the printer. Is
the model ID, representing the model of the printer. Is the code ID, specifying the character code used by the printer. Enables space-
compensation mode. Many of the existing tools for text alignment cannot handle nonspacing characters properly. When printing output from
such tools, enabling space-compensation mode improves alignment of output text. Specifies the page width in columns. The default value is
80.
OPERANDS
Specifies the file to record accounting information.
DESCRIPTION
The thailpof filter is a generic print filter for Thai text files. The filter handles the device dependencies of printers and performs
accounting functions. At print job completion times, accounting records are written to the file specified by the af field in /etc/print-
cap.
The filter can handle plain text files and files that have been preprocessed by nroff. Either kind of file can contain Thai characters.
The thailpof filter translates nroff control sequences for underlining, superscripting, and subscripting into the proper control sequences
for the printer.
The thailpof filter can be the specified filter in both the of and the if fields in the /etc/printcap file. For a description of these
fields, see printcap(4).
To print Thai characters on the flag page using 3-pass mode, you must specify /usr/lbin/thailpof in the of field of the /etc/printcap file.
In 3-pass mode, however, the flag page is not printed on one page. Therefore, if you do not plan to print Thai characters on the flag
page, or if you are using one-pass mode, do not specify /usr/lbin/thailpof in the of field.
NOTES
The lpr command supports a number of options and associated arguments to enable localization features supported by various printers. The
following can be used with the thailpof filter: To specify one-and-a-half line printing To enable space-compensation mode. To specify the
pathname of the character code table
For a complete description of this option and its associated arguments or values, refer to lpr(1).
ERRORS
The lf field (default value is /dev/null) in the /etc/printcap file specifies the name of the error log.
SEE ALSO
Commands: lpr(1), pr(1), lpd(8), pac(8)
Files: printcap(4)
Others: i18n_printing(5)
thailpof(8)