Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Extract Unique Values from file Post 302349337 by simonsimon on Monday 31st of August 2009 05:36:25 PM
Old 08-31-2009
Question Extract Unique Values from file

Hello all,

I have a file with following sample data

2009-08-26 05:32:01.65 spid5 Process ID 86:214 owns resources that are blocking processes on Scheduler 0.
2009-08-26 05:32:01.65 spid5 Process ID 86:214 owns resources that are blocking processes on Scheduler 0.
2009-08-26 05:32:01.65 spid5 Process ID 84:127 owns resources that are blocking processes on Scheduler 2.
2009-08-26 09:49:53.46 spid5 Process ID 86:214 owns resources that are blocking processes on Scheduler 0.
2009-08-26 15:51:28.51 spid5 Process ID 102:17 owns resources that are blocking processes on Scheduler 12.
2009-08-26 15:51:28.51 spid5 Process ID 102:17 owns resources that are blocking processes on Scheduler 12.
2009-08-26 15:51:28.51 spid5 Process ID 102:17 owns resources that are blocking processes on Scheduler 12.


I need to extract the unique Process IDs

So the output should be { though the order does not matter }

86
84
102

Its the unique values occuring between "Process ID" and the ":" on each line excluding the blank white space after ID . Process ID 102:

Any suggestions ?Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Getting Unique values in a file

Hi, I have a file like this: Some_String_Here 123 123 123 321 321 321 3432 3221 557 886 321 321 I would like to find only the unique values in the files and get the following output: Some_String_Here 123 321 3432 3221 557 886 I am trying to get this done using awk. Can someone please... (5 Replies)
Discussion started by: Legend986
5 Replies

2. Shell Programming and Scripting

Unique values from a Terabyte File

Hi, I have been dealing with a files only a few gigs until now and was able to get out by using the sort utility. But now, I have a terabyte file which I want to filter out unique values from. I have a server having 8 processor and 16GB RAM with a 5 TB hdd. Is it worthwhile trying to use... (6 Replies)
Discussion started by: Legend986
6 Replies

3. UNIX Desktop Questions & Answers

Fetching unique values from file

After giving grep -A4 "feature 1," <file name> I have extracted the following text feature 1, subfeat 2, type 1, subtype 5, dump '30352f30312f323030392031313a33303a3337'H -- "05/01/2009 11:30:37" -- -- ... (1 Reply)
Discussion started by: shivi707
1 Replies

4. Shell Programming and Scripting

extract unique pattern from large text file

Hi All, I am trying to extract data from a large text file , I want to extract lines which contains a five digit number followed by a hyphen , like 12345- , i tried with egrep ,eg : egrep "+" text.txt but which returns all the lines which contains any number of digits followed by hyhen ,... (19 Replies)
Discussion started by: shijujoe
19 Replies

5. Shell Programming and Scripting

How to count Unique Values from a file.

Hi I have the following info in a file - <Cell id="25D"/> <Cell id="26A"/> <Cell id="26B"/> <Cell id="26C"/> <Cell id="27A"/> <Cell id="27B"/> <Cell id="27C"/> <Cell id="28A"/> I would like to know how would you go about counting all... (4 Replies)
Discussion started by: Prega
4 Replies

6. Shell Programming and Scripting

Create shell script to extract unique information from one file to a new file.

Hi to all, I got this content/pattern from file http.log.20110808.gz mail1 httpd: Account Notice: close igchung@abc.com 2011/8/7 7:37:36 0:00:03 0 0 1 mail1 httpd: Account Information: login sastria9@abc.com proxy sid=gFp4DLm5HnU mail1 httpd: Account Notice: close sastria9@abc.com... (16 Replies)
Discussion started by: Mr_47
16 Replies

7. Shell Programming and Scripting

List unique values and count instances in .csv file

I need to take the second column of a .csv file and count the number of instances of each unique value in that same second column. I'd like the output to be value,count sorted by most instances. Thanks for any guidance! Data example: 317476,317756,0 816063,318861,0 313123,319091,0... (4 Replies)
Discussion started by: batcho
4 Replies

8. Shell Programming and Scripting

Extract UNIque records from File

Hi, I have a file with 20GB Pipe Delimited file where i have too many duplicate records. I need an awk script to extract the unique records from the file and put it into another file. Kindly help. Thanks, Arun (1 Reply)
Discussion started by: Arun Mishra
1 Replies

9. Shell Programming and Scripting

Extracting unique values of a column from a feed file

Hi Folks, I have the below feed file named abc1.txt in which you can see there is a title and below is the respective values in the rows and it is completely pipe delimited file ,. ... (4 Replies)
Discussion started by: punpun66
4 Replies

10. Shell Programming and Scripting

Using grep and a parameter file to return unique values

Hello Everyone! I have updated the first post so that my intentions are easier to understand, and also attached sample files (post #18). I have over 500 text files in a directory. Over 1 GB of data. The data in those files is organised in lines: My intention is to return one line per... (23 Replies)
Discussion started by: clippertm
23 Replies
FORK(2) 							System Calls Manual							   FORK(2)

NAME
fork, rfork - manipulate process resources SYNOPSIS
#include <u.h> #include <libc.h> int fork(void) int rfork(int flags) DESCRIPTION
Forking is the only way new processes are created. The flags argument to rfork selects which resources of the invoking process (parent) are shared by the new process (child) or initialized to their default values. The resources include the file name space, the open file descriptor table (which, when shared, permits processes to open and close files for other processes), the set of environment variables (see env(3)), the note group (the set of processes that receive notes written to a member's notepg file; see proc(3)), and open files. Flags is the logical OR of some subset of RFPROC If set a new process is created; otherwise changes affect the current process. RFNOWAIT If set, the child process will be dissociated from the parent. Upon exit the child will leave no Waitmsg (see wait(2)) for the par- ent to collect. RFNAMEG If set, the new process inherits a copy of the parent's name space; otherwise the new process shares the parent's name space. The tag space for rendezvous(2) is considered part of the name space. Is mutually exclusive with RFCNAMEG. RFCNAMEG If set, the new process starts with a clean name space. A new name space must be built from a mount of an open file descriptor. Is mutually exclusive with RFNAMEG. RFENVG If set, the environment variables are copied; otherwise the two processes share environment variables. Is mutually exclusive with RFCENVG. RFCENVG If set, the new process starts with an empty environment. Is mutually exclusive with RFENVG. RFNOTEG Each process is a member of a group of processes that all receive notes when a note is written to any of their notepg files (see proc(3)). The group of a new process is by default the same as its parent, but if RFNOTEG is set (regardless of RFPROC), the process becomes the first in a new group, isolated from previous processes. RFFDG If set, the invoker's file descriptor table (see intro(2)) is copied; otherwise the two processes share a single table. RFCFDG If set, the new process starts with a clean file descriptor table. Is mutually exclusive with RFFDG. RFMEM If set, the kernel will mark segments of type data and bss as shared. The child will then inherit all the shared segments the parent process owns. Other segment types will be unaffected. Subsequent forks by the parent will then propagate the shared data and bss between children. The stack segment is always split. May be set only with RFPROC. File descriptors in a shared file descriptor table are kept open until either they are explicitly closed or all processes sharing the table exit. If RFPROC is set, the value returned in the parent process is the process id of the child process; the value returned in the child is zero. Without RFPROC, the return value is zero. Process ids range from 1 to the maximum integer (int) value. Rfork will sleep, if necessary, until required process resources are available. Fork is just a call of rfork(RFFDG|RFPROC). SOURCE
/sys/src/libc/9syscall /sys/src/libc/9sys/fork.c SEE ALSO
intro(2), proc(3), DIAGNOSTICS
These functions set errstr. FORK(2)
All times are GMT -4. The time now is 10:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy