Sponsored Content
Top Forums Shell Programming and Scripting iterate through list of numbers and print specific lines with awk Post 302454167 by Chirel on Friday 17th of September 2010 09:47:08 AM
Old 09-17-2010
Code:
awk '/ACCEPTED/{print "processing images "x" - "y" Average is "int(tot/nb)}/IMAGE/{getline;tot=nb=0;x=$1}$7>0{tot+=$7;nb++}NF{y=$1}' file

This User Gave Thanks to Chirel For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to print specific lines with awk

Hi! How can I print out a specific range of rows, like "cat file | awk NR==5,NR==9", but in the END-statement? I have a small awk-script that finds specific rows in a file and saves the line number in an array, like this: awk ' BEGIN { count=0} /ZZZZ/ { list=NR ... (10 Replies)
Discussion started by: Bugenhagen
10 Replies

2. Shell Programming and Scripting

print first few lines, then apply regex on a specific column to print results.

abc.dat tty cpu tin tout us sy wt id 0 0 7 3 19 71 extended device statistics r/s w/s kr/s kw/s wait actv wsvc_t asvc_t %w %b device 0.0 133.2 0.0 682.9 0.0 1.0 0.0 7.2 0 79 c1t0d0 0.2 180.4 0.1 5471.2 3.0 2.8 16.4 15.6 15 52 aaaaaa1-xx I want to skip first 5 line... (4 Replies)
Discussion started by: kchinnam
4 Replies

3. Shell Programming and Scripting

Problems to print specific lines with awk and grep...HELP!

Hi all I have data like this: model: 1, misfit value: 0.74987 1 1.182 1.735 2.056 1.867 2 0.503 1.843 2.018 1.888 3 2.706 2.952 2.979 1.882 4 8.015 3.414 3.675 1.874 ... (1 Reply)
Discussion started by: fedora2011
1 Replies

4. Shell Programming and Scripting

print lines containing only numbers

Hi boys, I have a txt file with a lot of lines. It have lines containing mostly only numbers but some of them contain numbers mixed with special characters and or letters or space.. its look like this: 271261621371 2727127f 27126|71372. ... Do you have any ideas of the easiest way to... (3 Replies)
Discussion started by: alekkz
3 Replies

5. Shell Programming and Scripting

Print Specific lines when found specific character

Hello all, I have thousand file input like this: file1: $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$ | | | |$$ $$ UERT | TTYH | TAFE | FRFG |$$ $$______|______|________|______|$$ $$ | | | |$$ $$ 1 | DISK | TR1311 | 1 |$$ $$ 1 |... (4 Replies)
Discussion started by: attila
4 Replies

6. UNIX for Dummies Questions & Answers

grep specific number from a list of numbers

Hello. I have 9060 files labelled File1 to File9060. They are in numerical order. When I grep a file eg. File90 it will show me all files that contain the pattern "File90", eg File901 or File9001. I can only get specific files for File1000 or higher. How can I resolve this problem? Is there a... (5 Replies)
Discussion started by: godzilla07
5 Replies

7. Shell Programming and Scripting

Print lines with numbers only.

Is there other way then this only solution I have found to print lines with numbers only? file.txtone two three 3 four five 5tt 6gfjdfgdf 9 66 six 0 seven 7 eight 546546 gffdg445gfg fd644 (7 Replies)
Discussion started by: Jotne
7 Replies

8. Shell Programming and Scripting

How to print with awk specific field different from specific character?

Hello, i need help with awk. I have this file: cat number DirB port 67 er_enc_out 0 er_bad_os 0 DirB port 71 er_enc_out 56 er_bad_os 0 DirB port 74 er_enc_out 0 er_bad_os 0 DirB port 75 ... (4 Replies)
Discussion started by: elilmal
4 Replies

9. Shell Programming and Scripting

Awk- Indexing a list of numbers in file2 to print certain rows in file1

Hi Does anyone know of an efficient way to index a column of data in file2 to print the coresponding row in file1 which corresponds to the data in file2 AND 30 rows preceding and after the row in file1. For example suppose you have a list of numbers in file2 (single column) as follows:... (6 Replies)
Discussion started by: Geneanalyst
6 Replies

10. UNIX for Beginners Questions & Answers

How to print lines from a files with specific start and end patterns and pick only the last lines?

Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" . I have attached sample input file and the desired input should be as: INPUT FORMAT: SELECT ABCD, DEFGH, DFGHJ, JKLMN, AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies
CNEE(1) 						      General Commands Manual							   CNEE(1)

NAME
cnee - record, replays or distributes X11 data SYNOPSIS
cnee [options] DESCRIPTION
The program cnee can record and replay an X session. cnee also has the ability to distribute events to multiple displays. cnee gets copies of X protocol data from the X server. These are either printed to file ( record mode) or replayed and synchronised ( replay mode). During record and replay cnee can distribute the record/replayed events to multiple displays. GENERAL OPTIONS
--err-file, -e <file> Redirect all Xnee verbose output file_name(default is stderr) --out-file, -o <file> Redirect all Xnee data to file_name(default is stdout) --display, -d <displayname> X server to contact (default is localhost) --all-clients, -ac Record all client's data (default) --data-to-record, -dtr <n> Intercept n numbers of data ( n<0 means forever) --time, -t <secs> Delay start of application for <secs> seconds. Can be used to prevent recording of KeyRelease when starting Xnee from terminal --record, -rec Set recording mode --replay, -rep Set replaying mode --distribute, -di <LIST> Distribute recorded or replayed events to LIST where LIST is comma separated list of displays --future-clients, -fc Record future client's data (default) --plugin, -p <name Use the plugin name --verbose, -v Enable verbose printout --feedback-xosd, -fx Use xosd to feedback --feedback-stderr, -fs Use stderr to feedback --feedback-none, -fn Dont' use feedback --device-event-range, -devera <X_LIST> Set device event range to X_LIST --keep-autorepeat, -ka Keep autorepeat during record/replay --no-reparent-recording, -nrr Prevent explicit recording of ReparentNotify event RECORD OPTIONS
--first-last Print only first and last of multiple successive MotionEvent --all-events Intercept all events --events-to-record, -etr <n> Intercept n numbers of events ( n<0 means forever) --seconds-to-record, -str <n> Intercept for n seconds ( n<0 means forever) --recorded-resolution <res> Resolution to use when recording is set to res --human-printout, -hp Prints human readable --store-mouse-position, -smp Store the initial position of the mouse --request-range, -reqra <X_LIST> Set request range to X_LIST --reply-range, -repra <X_LIST> Set reply range to X_LIST --delivered-event-range, -devra <X_LIST> Set delivered event range to X_LIST --error-range, -erra <X_LIST> Set error range to X_LIST --extension-request-major-range, -erqmar <X_LIST> Set extension request major range to X_LIST --extension-request-minor-range, -erqmir <X_LIST> Set extension request minor range to X_LIST --extension-reply-major-range, -erpmar <X_LIST> Set extension reply major range to X_LIST --extension-reply-minor-range, -erpmir <X_LIST> Set extension reply minor range to X_LIST REPLAY OPTIONS
--speed-percent, -sp <speed> Set replaying speed percentage is set to speed --replay-resolution <res> Resolution to use when replaying is set to res --resolution-adjustment Use resolution adjustment --synchronised-replay Synchronise during replay --no-synchronise, -ns Don't use synchornisation during replay --recall-window-position, -rwp Recall the recorded window position to be used during replay --force-replay, -fp Keep replaying even if we are out of sync .... dangerous --buffer-verbose, -bv Enable verbose printout of replay buffer --max-threshold, -mat <nr> Set the maximum threshold for sync to nr --min-threshold, -mit <nr> Set the minimum threshold for sync to tnr --tot-threshold, -tot <nr> Set the total threshold for sync to nr --replay-offset, -ro <x,y> Set the replay offset to (x,y) CNEE OPTIONS
--file, -f <file_name> Read data from file file_name (default is stdin) --help, -h Print this message --flags Prints all flags/options xnee accepts --project, -pr <file_name> Use project file file_name --version, -V Print product information --retype-file <file> Types (faking user) the contents of the specified file --write-settings <file> Writes settings to a resource file --print-settings, -ps Prints Xnee settings and waits (for <ENTER>) --print-event-names, -pens Prints X11 event number and name --print-event-name, -pen <ev> Prints X11 event number or name coresponding to ev --print-error-names, -perns Prints X11 error number and name --print-error-name, -pern <er> Prints X11 error number or name coresponding to er --print-reply-names, -pren Prints X11 reply number and name --print-request-names, -prns Prints X11 request number and name --print-request-name, -prn <req> Prints X11 request number or name coresponding to req --keyboard Record the keyboard --mouse Record mouse events --print-data-names, -pdn Prints X11 data number and name --manpage Prints Xnee help text in format as used when generating man page --texipage Prints Xnee help text in format as used when generating info page --type-help Type this help message using faked keys (used to test xnee itself) --demonstration, -demo Let Xnee take you on a demonstration ride --check-syntax, -cs Check syntax of the command line and/or project file (no exec) --get-xinput-event-base, -gxeb Get the event base for Xinput Extension --disable-xinput-events, -dxe Disable recording of XInput events --replay-backend, -rb <backend> --force-core-replay, -fcr Discard record X Input device data, use recorded core device data --record-replay, -rr Record and replay a session (press q to stop recording) COMMENTS
file_name Name of a file (e.g /tmp/my_file.xns) display_name Name of a display (e.g 192.168.1.12:0 secs Seconds (e.g 10) n Integer number (e.g 100) LIST Comma separated list of display (e.g 192.168.1.12:0,129.12.23.0:0) X_LIST Comma separated list of integers (e.g 12-23,35,45-56) EXAMPLES
cnee --record --events-to-record 1000 --mouse --keyboard -o /tmp/xnee.xns -e /tmp/xnee.log -v Records 1000 events (keyboard and mouse) to file /tmp/xnee.xns and dumps the verbose printout to /tmp/xnee.log cnee --replay -f /tmp/xnee.xns -v -e /tmp/xnee.log -ns Read data from /tmp/xnee.xns, replay it and verbose print to file /tmp/xnee.log For more examples, read the Xnee manual AUTHOR
Henrik Sandklef. REPORTING BUGS
Report bugs in the program to bug-xnee@gnu.org. COPYRIGHT
Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Henrik Sandklef. This is free software; see the source for copying conditions. There is NO warranty;not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. SEE ALSO
cnee(info),xnee(info),xev(1) VERSION
xnee man page, version 3.13 NOTES
This page describes cnee. Mail corrections and additions to bug-xnee@gnu.org xnee 2007 CNEE(1)
All times are GMT -4. The time now is 02:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy