Sponsored Content
Full Discussion: Data mining a text file.
Top Forums Shell Programming and Scripting Data mining a text file. Post 302205119 by drl on Friday 13th of June 2008 02:03:43 PM
Old 06-13-2008
Hi.
If you want to enumerate all the like items:
Code:
#!/bin/bash -

# @(#) s1       Demonstrate counting occurrences.

echo
echo "(Versions displayed with local utility \"version\")"
version >/dev/null 2>&1 && version =o $(_eat $0 $1) cut sort uniq
echo

FILE=${1-data1}

cut -d" " -f3- $FILE |
sort |
uniq -c

exit 0

Producing:
Code:
$ ./s1

(Versions displayed with local utility "version")
SunOS 5.10
GNU bash 3.00.16
cut - no version provided for /usr/bin/cut.
sort - no version provided for /usr/xpg4/bin/sort.
uniq - no version provided for /usr/bin/uniq.

   2 adm 4
   2 bin 2
   2 daemon 1
   2 gdm 50
   2 listen 37
   2 lp 71
   1 noaccess 60002
   1 noaccess 60003
   2 nobody 60001
   2 nuucp 9
   2 root 0
   2 smmsp 25
   2 sys 3
   2 uucp 5
   2 webservd 80

See man pages for details ... cheers, drl
 

4 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting data from text file based on configuration set in config file

Hi , a:) i have configuration file with pattren <Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output> eg: myfile.confg 9899000000,9899999999,DATA,b.dat 9899000000,9899999999,SMS,a.dat b:) Stucture of my data file is... (3 Replies)
Discussion started by: suparnbector
3 Replies

2. Shell Programming and Scripting

Find and replace data in text file with data in same file

OK I will do my best to explain what I need help with. I am trying to format an ldif file so I can import it into Oracle oid. I need the file to look like this example. Keep in mind there are 3000 of these in the file. changetype: modify replace: userpassword dn:... (0 Replies)
Discussion started by: timothyha22
0 Replies

3. Shell Programming and Scripting

Filter a .kml file (xml) with data set from text file

I have a .kml file. So I want filter the .kml to get only the tags that have this numeric codes that they are in a text file 11951 11952 74014 11964 11965 11969 11970 11971 11972 60149 74018 74023 86378 11976 11980 11983 11984 11987 (5 Replies)
Discussion started by: pcoj33
5 Replies

4. Shell Programming and Scripting

Compare 2 text file with 1 column in each file and write mismatch data to 3rd file

Hi, I need to compare 2 text files with around 60000 rows and 1 column. I need to compare these and write the mismatch data to 3rd file. File1 - file2 = file3 wc -l file1.txt 58112 wc -l file2.txt 55260 head -5 file1.txt 101214200123 101214700300 101250030067 101214100500... (10 Replies)
Discussion started by: Divya Nochiyil
10 Replies
audswitch(2)							System Calls Manual						      audswitch(2)

NAME
audswitch() - suspend or resume auditing on the current process SYNOPSIS
DESCRIPTION
suspends or resumes auditing within the current process. This call is restricted to users with the privilege. One of the following flags must be used for aflag: Suspend auditing on the current process. Resume auditing on the current process. can be used in processes with the privilege to temporarily suspend auditing during intervals where auditing is to be handled by the process itself. Auditing is suspended by a call to with the parameter and resumed later by a call to with the parameter. An call to resume auditing serves only to reverse the action of a previous call to suspend auditing. A call to to resume auditing when auditing is not suspended has no effect. affects only the current process. For example, cannot suspend auditing for processes from the current process. (Use (see setaudproc(2)) to enable or disable auditing for a process and its children). Security Restrictions Some or all of the actions associated with this system call require the privilege. Processes owned by the superuser have this privilege. Processes owned by other users may have this privilege, depending on system configuration. See privileges(5) for more information about privileged access on systems that support fine-grained privileges. RETURN VALUE
Upon successful completion, returns If an error occurs, is returned and the global variable is set to indicate the error. ERRORS
fails if one of the following is true: The user does not possess the privilege. The input parameter is neither nor AUTHOR
was developed by HP. SEE ALSO
audevent(1M), audusr(1M), setaudproc(2), audit(5), privileges(5). audswitch(2)
All times are GMT -4. The time now is 12:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy