Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Help with BASH/AWK queries .... Post 302478945 by binlib on Thursday 9th of December 2010 09:11:50 AM
Old 12-09-2010
If you need to do the processing for a pair of score and data file at a time, just loop through them:
Code:
for i in 1 2 3; do
awk '{...}' score$i.txt ... data$i.txt
done

On the other hand if you only need to do one processing but need to treat all the score files as one score, and all the data files as one, then either you can just cat all the score file together as one big score file, same for data. Or you can change the code a little bit:
Code:
awk '
RS != ">" && $5 != 0 {
  if ($4 > m1) {
    m2 = m1 
    c2 = c1
    m1 = $4
    c1 = $1
  } else if ($4 > m2) {
    m2 = $4 
    c2 = $1
  }
}
RS== ">"  && ($1 == c1 || $1 == c2)
' score*.txt RS='>' ORS='' data*.txt

 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Some queries...

Guys need some advice on how to check some of the questions below? i'm running on an open VMS platform... which i am an idiot to... appreciate if anyone can give some hints or source on how to check on.. a script that is running on cron job... but doesn't run as the login user name.. 1. why... (6 Replies)
Discussion started by: 12yearold
6 Replies

2. UNIX for Advanced & Expert Users

Two small queries

Query 1 : How to check if a directory already exists? If doesn't exist then create a new one. Query 2 : I want to put following text using a single echo statement into a log file and also want to retain the formatting of the text. How it can be... (3 Replies)
Discussion started by: skyineyes
3 Replies

3. Shell Programming and Scripting

my queries

hi guys Well, i need to have a report generation script or any script which will show me all the content/information of a file when i run that script. Please help me on this isssue at the earliest.As i am little bit aware of scripting.Thanks in advance! regards ash (4 Replies)
Discussion started by: whizkidash
4 Replies

4. Homework & Coursework Questions

Queries

Any help on like where to get started on this? I'm just confused. 1. The problem statement, all variables and given/known data: Enter text here.Queries to satisfy these two report requests (use your CCI database): Retrieve all rows of active inventory where current on hands is less than... (0 Replies)
Discussion started by: lakers34kb
0 Replies

5. UNIX for Advanced & Expert Users

awk script queries

Hi, First query: I am trying to execute the below command to pull all the record whose length is not of the expected. But this is not giving the expected results. $2 is the record length passed in the script as second parameter.$filename is the filename on which the awk is executed.It is... (4 Replies)
Discussion started by: devina
4 Replies

6. Shell Programming and Scripting

Few queries regarding awk...

One of the command output is as below. -rw-r--r--+ 1 root root 75G Nov 21 16:43 /var/ovs/mount/86BXXX/running_pool/Machine1/System-sda.img -rw-r--r--+ 1 root root 75G Nov 21 16:36 /var/ovs/mount/86BXXX/running_pool/Machine2/System.img -rw-r--r--+ 1 root root 150G Sep 23 19:13... (2 Replies)
Discussion started by: pinga123
2 Replies

7. UNIX for Advanced & Expert Users

How many DNS queries

Is there any way to see how many queries come into our external DNS server? In looking at DNS providers, most of them base pricing on number of queries per month so I just wanted to see if you had any idea/way of gathering that data? A rough ballpark figure would even work. Our DNS server is... (1 Reply)
Discussion started by: raggmopp
1 Replies

8. UNIX for Dummies Questions & Answers

FTP Queries

Hi, 1) How to get exact permissions, group names for files while transferring with FTP 2) Is there any command to transfer entire directory and sub directories. Thanks (1 Reply)
Discussion started by: nag_sathi
1 Replies

9. Debian

GRUB Queries ?!

Hello, I am posting the following questions here because I need them answered by people who have actually done a lot of work in GRUB. DO NOT GIVE ME GUESS ANSWERS PLEASE. Feel free to redirect me if this is not the right place to ask these questions. Can I download GRUB separately from... (6 Replies)
Discussion started by: sreyan32
6 Replies

10. IP Networking

RDNS Queries

Hey everyone, I have a question, I've been playing around with tcpdump, and noticed my machine making numerous rdns look ups. They are displayed like: 10.80.80.141.51234 > 10.80.80.1.domain: 9950+ PTR? 223.114.55.65.in-addr.arpa. (44) My question is, if dns works based on numerical... (0 Replies)
Discussion started by: Lost in Cyberia
0 Replies
TENMADO(6)							  tenmado manual							TENMADO(6)

NAME
tenmado - hard-core shoot 'em up game in blue-or-red world SYNOPSIS
tenmado [ --dump stage ] [ --full-screen ] [ --help ] [ --slow ] [ --stage stage ] [ --undump stage ] [ --undump-default ] [ --version ] DESCRIPTION
tenmado is a vertically scrolling, late 1990s style (that is, a massive number of enemy shots against a smaller-than-it-looks spaceship) shoot 'em up game. A very accurate collision detection makes it a game of dexterity. If something looks like a triangle, it is a trian- gle, not a rectangle of similar size. However, surviving is only 20% of the game. The main feature of tenmado is the "color chain bonus". You can get a very big score (about 100 times bigger than a normal enemy-destruction point) by destroying enemies of the same color successively. It is easy or difficult depending on how greedy you are. In the game, use cursor keys to move, press space key to shoot (auto-repeat). A joystick is also available for move and shoot. Note that you must plug the joystick before you invoke tenmado. For more information, see the tutorial demo by choosing it from the menu in the title. Also check the README file which can be found at /usr/share/doc/tenmado/README . OPTIONS
--dump stage Write high score data to standard output and exit. Usually you save the output in a file and later use that file as the input of --undump. stage must be between 0 and 5. stage 0 means total score. stage 1 -- 5 means each stage score. --full-screen Run the game in the full screen mode. --help Print a help message and exit. --slow Run the game at the half speed. Technically, the length of waiting between each frame is doubled. This slows down everything in the game, including your ship. The idea is to study the enemy formations for a later (normal speed) play. The animation may be rough because this option gives you only about 16 fps. You can't enter the high score lists with this option. --stage stage Start the game at the specified stage. stage must be between 1 and 5. Note that you can play only one stage (the specified one) and you can't enter the high score lists. --undump stage Read high score data from standard input, save them and exit. The input is usually the output of --dump. stage must be between 0 and 5. stage 0 means total score. stage 1 -- 5 means each stage score. Only the superuser may use this option. --undump-default If at least one high score list is empty, read the default high score data, save them and exit. If not, do nothing. The main pur- pose of this option is to create high score database files at installation time so that you can set their permission. --version Print version information, license information and the disclaimer, then exit. BUGS
Please report any bugs you find to Oohara Yuuma <oohara@libra.interq.or.jp>. AUTHOR
Oohara Yuuma <oohara@libra.interq.or.jp> Project Geeste Thu, 16 Jan 2003 TENMADO(6)
All times are GMT -4. The time now is 11:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy