LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-15-2012, 09:09 AM   #1
oreka18
LQ Newbie
 
Registered: May 2012
Posts: 7

Rep: Reputation: Disabled
gathering some commands in one file


i wrote 5 awk commands such as below,
Code:
awk '{gsub("[C || D]"," ",$5)}1' input > 1

awk '/^ *200?/{x=$1$2;y="? ? ?";while($1!~/STAT/)getline;next}!/^ *$/{sub(/^./,"",$3);print $1,y,$3,"?",x,$5,$6;}/^ *$/{print}' 1 > 2

awk '$1!~"[A-Z][A-Z][A-Z]" {print "###"}1' 2 > 3

awk '$1~"###" || $1~"MRD | | SHB | | TBZ | | HRS | | AZR | | BST | | SRB | | HSH | | LIN | | DHR | | VIS | | BZA | | KOM | | GHG | | RAZ | | MHD | | GZV "|| $5~"[p || P || s || S][a,zA-Z]" {print $0}' 3 > 4

awk 'NF > 2 && $5~"[p || P][n || N]" {$10="GAU  2.00e-01  0.00e-01  0.00e-01  0.00e-01" $10} $5~"[p || P][g || G]" {$10="GAU  1.00e-01  0.00e-01  0.00e-01  0.00e-01" $10} $5~"[s || S][n || N]" {$10="GAU  4.00e-01  0.00e-01  0.00e-01  0.00e-01" $10} $5~"[s || S][g || G]" {$10="GAU  4.00e-01  0.00e-01  0.00e-01  0.00e-01" $10}1' 4 > output
i want to put these commands into one file as name as test.awk and run it ./test.awk in terminal.

Last edited by oreka18; 05-15-2012 at 09:33 AM.
 
Old 05-15-2012, 10:01 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
Please don't create multiple threads asking essentially the same question.
You've been given a perfectly good answer in your other thread here:


http://www.linuxquestions.org/questi...5/#post4678006


Just adapt the advice there to your current needs. You can still post back for help if you can't get it to work on your own.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Gathering entropy robel Linux - Security 23 10-19-2008 03:52 AM
Database Gathering Adler Linux - General 0 10-28-2004 08:48 PM
Information Gathering xathras Linux - Networking 4 06-28-2004 01:23 PM
Magic The Gathering and IE tcaptain LinuxQuestions.org Member Success Stories 7 04-06-2004 03:50 PM
Linux gathering Ztyx Linux - General 1 06-29-2002 03:00 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration