Sponsored Content
Full Discussion: Data mining a text file.
Top Forums Shell Programming and Scripting Data mining a text file. Post 302204888 by ghostdog74 on Thursday 12th of June 2008 09:52:26 PM
Old 06-12-2008
Code:
awk '/(root|[^n]uucp)/  { 
 total[$(NF-1)]++
}END {
 for( i in total) {
  print i,total[i]
 }
}' file

 

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
iotop(1m)							   USER COMMANDS							 iotop(1m)

NAME
iotop - display top disk I/O events by process. Uses DTrace. SYNOPSIS
iotop [-C] [-D|-o|-P] [-j|-Z] [-d device] [-f filename] [-m mount_point] [-t top] [interval [count]] DESCRIPTION
iotop tracks disk I/O by process, and prints a summary report that is refreshed every interval. This is measuring disk events that have made it past system caches. Since this uses DTrace, only users with root privileges can run this command. OPTIONS
-C don't clear the screen -D print delta times - elapsed, us -j print project ID -o print disk delta times, us -P print %I/O (disk delta times) -Z print zone ID -d device instance name to snoop (eg, dad0) -f filename full pathname of file to snoop -m mount_point mountpoint for filesystem to snoop -t top print top number only EXAMPLES
Default output, print summary every 5 seconds # iotop One second samples, # iotop 1 print %I/O (time based), # iotop -P Snoop events on the root filesystem only, # iotop -m / Print top 20 lines only, # iotop -t 20 Print 12 x 5 second samples, scrolling, # iotop -C 5 12 FIELDS
UID user ID PID process ID PPID parent process ID PROJ project ID ZONE zone ID CMD command name for the process DEVICE device name MAJ device major number MIN device minor number D direction, Read or Write BYTES total size of operations, bytes ELAPSED total elapsed times from request to completion, us (this is the elapsed time from the disk request (strategy) to the disk completion (iodone)) DISKTIME total times for disk to complete request, us (this is the time for the disk to complete that event since it's last event (time between iodones), or, the time to the strategy if the disk had been idle) %I/O percent disk I/O, based on time (DISKTIME) load 1 minute load average disk_r total disk read Kb for sample disk_w total disk write Kb for sample DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs directory. The DTraceToolkit docs may include full worked examples with ver- bose descriptions explaining the output. EXIT
iotop will run forever until Ctrl-C is hit, or the specified interval is reached. AUTHOR
Brendan Gregg [Sydney, Australia] SEE ALSO
iosnoop(1M), dtrace(1M) version 0.75 Oct 25, 2005 iotop(1m)
All times are GMT -4. The time now is 07:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy