Sponsored Content
Top Forums Shell Programming and Scripting Print all the fields of record using awk Post 302526673 by raghavendra.nsn on Wednesday 1st of June 2011 06:52:55 AM
Old 06-01-2011
OUPUT is looks like this

HTML Code:
spool /opt/nsn/robot/spool/Actual_RAW_JOB.txt;
 select count(*), IMSI FROM saidata.US_TFP_DNS_1 where IMSI in (select distinct IMSI from saidata.US_TFP_DNS_1) group by IMSI order by IMSI asc;
 select count(*), APN FROM saidata.US_TFP_DNS_1 where APN in (select distinct APN from saidata.US_TFP_DNS_1) group by APN order by APN asc;
 select count(*), IMEI FROM saidata.US_TFP_DNS_1 where IMEI in (select distinct IMEI from saidata.US_TFP_DNS_1) group by IMEI order by IMEI asc;
 select count(*), EVENT_AMOUNT FROM saidata.US_TFP_DNS_1 where EVENT_AMOUNT in (select distinct EVENT_AMOUNT from saidata.US_TFP_DNS_1) group by EVENT_AMOUNT order by EVENT_AMOUNT asc;
 select count(*), CAUSE_PROC FROM saidata.US_TFP_DNS_1 where CAUSE_PROC in (select distinct CAUSE_PROC from saidata.US_TFP_DNS_1) group by CAUSE_PROC order by CAUSE_PROC asc;
 select count(*), CHARGING_INFO FROM saidata.US_TFP_DNS_1 where CHARGING_INFO in (select distinct CHARGING_INFO from saidata.US_TFP_DNS_1) group by CHARGING_INFO order by CHARGING_INFO asc;
 select count(*), RAG1 FROM saidata.US_TFP_DNS_1 where RAG1 in (select distinct RAG1 from saidata.US_TFP_DNS_1) group by RAG1 order by RAG1 asc;
 select count(*), RAG2 FROM saidata.US_TFP_DNS_1 where RAG2 in (select distinct RAG2 from saidata.US_TFP_DNS_1) group by RAG2 order by RAG2 asc;
 select count(*) from saidata.US_TFP_DNS_1;
 spool off;
 exit;
it is generating only 8 statements in forloop but i am expecting as many fileds in the input file
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk: record has too many fields

Hi, I'm trying this command - but get this error. Do you guys have any workaround for this? cat tf|sed 's/{//g'|sed 's/,//g'|awk '{for (i=1;i<=NF;i++) {if ($i == "OPTIME") {k = i + 2; print $i,$k}}}' awk: record `2005 Jul 28 17:35:29...' has too many fields record number 15 This is how... (3 Replies)
Discussion started by: chaandana
3 Replies

2. Shell Programming and Scripting

awk /nawk :: print the everything except the first and the last fields

format of file1 "file1.txt" 1 2 3 4 A B C XX YY ZZ AA WWW The output must contain except the first and last column the output must be 2 3 B YY ZZ AA (8 Replies)
Discussion started by: centurion_13
8 Replies

3. Shell Programming and Scripting

awk - print record with both string1 and string2

How do I use awk to find the records in a file that contains two specific strings? I have tried piping and using awk two times, but I don't know how to do it in one action. (2 Replies)
Discussion started by: locoroco
2 Replies

4. Shell Programming and Scripting

awk text record - prepend first field to all subsequent fields

Hello everyone, I've suddenly gotten very interested in sed and awk (and enjoying it quite a bit too) because of a large conversion project that we're working on. I'm currently stuck with a very inefficient process for processing text blocks. I'm sure someone here should be able to easily point out... (2 Replies)
Discussion started by: jameswatson3
2 Replies

5. Shell Programming and Scripting

AWK exclude first and last record, sort and print

Hi everyone, I've really searched for a solution to this and this is what I found so far: I need to sort a command output (here represented as a "cat file" command) and from the second down to the second-last line based on the second row and then print ALL the output with the specified section... (7 Replies)
Discussion started by: dentex
7 Replies

6. Shell Programming and Scripting

AWK print initial record and double

I have an initial record 0.018 I would like a script that would for i=0;i<200;i++ print 0.018*1 0.018*2 0.018*3 0.018*4 ... 0.018*200 using newline. (7 Replies)
Discussion started by: chrisjorg
7 Replies

7. UNIX for Dummies Questions & Answers

keeping last record among group of records with common fields (awk)

input: ref.1;rack.1;1 #group1 ref.1;rack.1;2 #group1 ref.1;rack.2;1 #group2 ref.2;rack.3;1 #group3 ref.2;rack.3;2 #group3 ref.2;rack.3;3 #group3 Among records from same group (i.e. with same 1st and 2nd field - separated by ";"), I would need to keep the last record... (5 Replies)
Discussion started by: beca123456
5 Replies

8. Shell Programming and Scripting

How to print 1st field and last 2 fields together and the rest of the fields after it using awk?

Hi experts, I need to print the first field first then last two fields should come next and then i need to print rest of the fields. Input : a1,abc,jsd,fhf,fkk,b1,b2 a2,acb,dfg,ghj,b3,c4 a3,djf,wdjg,fkg,dff,ggk,d4,d5 Expected output: a1,b1,b2,abc,jsd,fhf,fkk... (6 Replies)
Discussion started by: 100bees
6 Replies

9. Shell Programming and Scripting

awk - compare 1st 15 fields of record with 20 fields

I'm trying to compare 2 files for differences in a selct number of fields. When differnces are found it will write the whole record of the second file including appending '|C' out to a delta file. Each record will have 20 fields, but only want to do comparison of 1st 15 fields. The 1st field of... (7 Replies)
Discussion started by: sljnk
7 Replies

10. Shell Programming and Scripting

awk sort based on difference of fields and print all fields

Hi I have a file as below <field1> <field2> <field3> ... <field_num1> <field_num2> Trying to sort based on difference of <field_num1> and <field_num2> in desceding order and print all fields. I tried this and it doesn't sort on the difference field .. Appreciate your help. cat... (9 Replies)
Discussion started by: newstart
9 Replies
asc(6)								   Games Manual 							    asc(6)

NAME
asc - Advanced Strategic Command - turn based strategy game SYNTAX
asc [options] DESCRIPTION
This program is a free (GPL) turn based strategy game in the tradition of BattleIsle 2/3. Game can be played against human or computer. It features a 2-dim. map that is tiled into hexagons where units are placed. The object of the game varies from map to map. The most commonly know goal is to completely eliminate an oppononet by detroying all his units. OPTIONS
The following options are supported: -x --xresolution <value> (640... default=800) Set horizontal resolution to <value> -y --yresolution <value> (480... default=600) Set vertical resolution to <value> -l --load <string> Load a map, saved game, or email game on startup -c --configfile <string> Use given configuration file -r --verbose <value> (0...10 default=0) Set verbosity level to <value> -w --window Disable fullscreen mode -f --fulscreen Enable fullscreen mode (overriding config file) -q --nosound Disable sound -h --help Display help information -v --version Output version SEE ALSO
asc_demount (6), asc_makegfx (6), asc_mapedit (6), asc_mount (6), asc_weaponguide (6) AUTHORS
The ASC game is developed by Martin Bickel <bickel@asc-hq.org>. This man page was written by Bartosz Fenski <fenio@o2.pl> (some parts were grabbed from Michael Moerz's work) for the Debian GNU/Linux dis- tribution (but it may be used by others). 1.15.0 asc(6)
All times are GMT -4. The time now is 06:33 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy