Sponsored Content
Full Discussion: Omit repeating lines
Top Forums UNIX for Dummies Questions & Answers Omit repeating lines Post 63037 by vgersh99 on Tuesday 22nd of February 2005 11:41:58 AM
Old 02-22-2005
Code:
lpstat -W "completed" -o | awk -F- '{arr[$1]++}END {for (i in arr) printf("Printer->[%s] Jobs->[%d]\n", i, arr[i])'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

merge 2 files (without repeating any lines)

I need to add the content of file1 to file2 - all lines but not those existing in file2 already, so the "cat file1 >> file2" doesn't work. For example, file1: 100 xxxxxx str1 102 xxxxxx str2 File2: 50 xxxxxxx xxx 30 xxxxxxxxxxx 102 xxxxxx str2 xxxx ...... the result: 50 xxxxxxx... (9 Replies)
Discussion started by: bluemoon1
9 Replies

2. Shell Programming and Scripting

Omit Blank Lines while comparing two files.

Hello All, I am writting file comparison Utility and I have encountered such a senario where there are 2 files such as follows- 1#!/usr/local/bin/python 2 import gsd.scripts.admin.control.gsdPageEscalate 3.gsd.scripts.admin.control.gsdPageEscalate.main() 1 #!/usr/local/bin/python... (10 Replies)
Discussion started by: Veenak15
10 Replies

3. Shell Programming and Scripting

Merging non-repeating columns of lines

Hello, I have file to work with. It has 5 columns. The first three, altogether, constitutes the position. The 4th column contains some values for downstream analysis and the fifth column contains some values that I want to add to 4th column (only if they happen to be in the same position). My... (5 Replies)
Discussion started by: menenuh
5 Replies

4. UNIX for Dummies Questions & Answers

Remove groups of repeating lines

I know uniq exists, but am not sure how to remove repeating lines when they are groups of two different lines repeating themselves, without using sort. I need them to be sorted in the original order, just to remove repeats. cd /media/AUDIO/WAVE/9780743518673/mp3 ~/Desktop/mp3-to-m4b... (1 Reply)
Discussion started by: glev2005
1 Replies

5. Shell Programming and Scripting

Removing repeating lines from a data frame (AWK)

Hey Guys! I have written a code which combines lots of files into one big file(.csv). However, each of the original files had headers on the first line, and now that I've combined the files the headers are interspersed throughout the new combined data frame. For example, throughout the data... (21 Replies)
Discussion started by: gd9629
21 Replies

6. Shell Programming and Scripting

Printing the lines which are repeating in a files

Hi, I need to find the lines which are repeating in a file cat file1 abcdef 23-1 abcdef 24-1 bcdeff 25-0 ttdcfg 26-0 ttdcfg 20-0 bcdef1 25-0 bcdef2 25-0 bcdef3 25-0 bcdef4 25-0 bcdef4 00-0any help is greatly appreciated. Thanks in advance. In need to find which one are... (3 Replies)
Discussion started by: jpkumar10
3 Replies

7. Shell Programming and Scripting

Compare last 90 logs and print repeating lines with >20

*log files are in date order sample logs... ciscoresets_20120314 ciscoresets_20120313 ciscoresets_20120312 ciscoresets_20120311 ciscoresets_20120310 cat ciscoresets_20120314 SYDGRE04,10,9 SYDGRE04,10,10 SYDGRE04,10,11 SYDGRE04,10,12 SYDGRE04,10,13 SYDGRE04,10,14 SYDGRE04,10,15... (2 Replies)
Discussion started by: slashbash
2 Replies

8. UNIX for Dummies Questions & Answers

Last line omit

I have a csv file "file.csv" which has 5 records but when I check record count for file.csv in unix it shows as 6, the last line is empty and I need to omit and need for processing. Kindly help. Thanks (6 Replies)
Discussion started by: Prashanth B
6 Replies

9. Shell Programming and Scripting

Deleting Repeating lines from a txt file via script

Hi, I'm having trouble in achieving the following scenario. There is a txt file with thousands of lines and few lines are repeated, which needs to be removed using a script. File.txt 20140522121432,0,12,ram Loc=India From=ram@xxx.com, To=ravi@yyy.com,, 1 2 3 4 . . 30... (18 Replies)
Discussion started by: Gautham
18 Replies

10. Shell Programming and Scripting

Bash repeating lines for some files but not all

The bash below executes and seems to work fine on those files in which . However on those files where there is no additional CNV detected that line repeats multiple times instead of only once. I tried adding an END as all lines are printed but that doesn't help. I can not seem to solve this... (5 Replies)
Discussion started by: cmccabe
5 Replies
ospm-pm(1)							   User Commands							ospm-pm(1)

NAME
ospm-pm - OpenSolaris Print Manager SYNOPSIS
ospm-pm [gnome-std-options] DESCRIPTION
The OpenSolaris Print Manager application enables you to control and manage print queues and print jobs. Currently, it supports on Solaris LP print system. You can use OpenSolaris Print Manager to perform the following tasks: o Create printer groups from a static list or based on some attributes of the printers o View print jobs on each printer, and remove print jobs that are queued o Add new printer queues manually o Integrate Print queues which were Auto-detected or auto-discovered into its GUI The tool can be invoked from the command line, but it is typically invoked from the desktop menu. OPTIONS
The following options are supported: gnome-std-options Standard options available for use with most GNOME applications. See gnome-std-options(5) for more infor- mation. EXAMPLES
Example 1: Launching OpenSolaris Print Manager. example% ospm-pm EXIT STATUS
The following exit values are returned: 0 Application exited successfully >0 Application exited with failure FILES
The following files are used by this application: /usr/bin/ospm-pm The executable file for OpenSolaris Print Manager application. $HOME/.ospm-printer-groups.xml Configuration file for printer groups. $HOME/.printers It supports printer(4) when user saves queues into the Favourites printer group. ATTRIBUTES
+-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWprint-monitor | +-----------------------------+-----------------------------+ |Interface stability |Volatile | +-----------------------------+-----------------------------+ SEE ALSO
gconf-editor(1), gconftool-2(1), ospm-preferences(1), libgconf-2(3), printer(4), gnome-std-options(5) NOTES
Written by Evan Yan, Sun Microsystems Inc., 2008. SunOS 5.11 07 Aug 2008 ospm-pm(1)
All times are GMT -4. The time now is 06:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy