Sponsored Content
Top Forums Shell Programming and Scripting Need awk help to print specific columns with as string in a header Post 302525416 by arv_cds on Thursday 26th of May 2011 03:47:15 PM
Old 05-26-2011
Sure.
Input with 4000 columns.
abc,xxkkk,eeee,eee,kkknn,sss,xxx,kkkvvv,yyy, ttt,mmm,fff..........
1,1,3,4,6,7,8,9,9,0,0,5
3,4,1,5,1,5,6,7,8,9,9,7,

Would like to print the colums with header which has substring of KKK
xxkkk, kkknn,kkkvvv
1,6,9
4,1,7

Thanks,
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

search a word and print specific string using awk

Hi, I have list of directory paths in a variable and i want to delete those dirs and if dir does not exist then search that string and get the correct path from xml file after that delete the correct directory. i tried to use grep and it prints the entire line from the search.once i get the entire... (7 Replies)
Discussion started by: dragon.1431
7 Replies

2. Shell Programming and Scripting

awk or sed command to print specific string between word and blank space

My source is on each line 98.194.245.255 - - "GET /disp0201.php?poc=4060&roc=1&ps=R&ooc=13&mjv=6&mov=5&rel=5&bod=155&oxi=2&omj=5&ozn=1&dav=20&cd=&daz=&drc=&mo=&sid=&lang=EN&loc=JPN HTTP/1.1" 302 - "-" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR... (5 Replies)
Discussion started by: elamurugu
5 Replies

3. Shell Programming and Scripting

Extract columns where header matches a given string

Hi, I'm having trouble pulling out columns where the headers match a file of key ID's I'm interested in and was looking for some help. file1.txt I Name 34 56 84 350 790 1215 1919 7606 9420 file2.txt I Name 1 1 2 2 3 3 ... 34 34... 56 56... 84 84... 350 350... M 1 A A A A... (20 Replies)
Discussion started by: flotsam
20 Replies

4. Shell Programming and Scripting

awk print specific columns one row at a time

Hello, I have the following piece of code: roleName =`cat $inputFile | awk -F';' '{ print $1 }'` roleDescription =`cat $inputFile | awk -F';' '{ print $2 }'` roleAuthProfile =`cat $inputFile | awk -F';' '{ print $3 }'` mappedUserID (5 Replies)
Discussion started by: pr0tocoldan
5 Replies

5. Shell Programming and Scripting

awk compare specific columns from 2 files, print new file

Hello. I have two files. FILE1 was extracted from FILE2 and modified thanks to help from this post. Now I need to replace the extracted, modified lines into the original file (FILE2) to produce the FILE3. FILE1 1466 55.27433 14.72050 -2.52E+03 3.00E-01 1.05E+04 2.57E+04 1467 55.27433... (1 Reply)
Discussion started by: jm4smtddd
1 Replies

6. Shell Programming and Scripting

Print columns matching to specific values

Hello Friends, I have a CDR file and i need to print out 2 columns with their field position which matches to some constant values, a part of input file CZ=1|CZA=1|DIAL=415483420001|EE=13|ESF=1|ET=|FF=0|9|MNC=99|MNP=9041|MTC=0|NID=2|NOA=international|ON=1| OutPut ... (3 Replies)
Discussion started by: EAGL€
3 Replies

7. UNIX for Dummies Questions & Answers

How to Detect Specific Pattern and Print the Specific String after It?

I'm still beginner and maybe someone can help me. I have this input: the great warrior a, b, c and what i want to know is, with awk, how can i detect the string with 'warrior' string on it and print the a, b, and c seperately, become like this : Warrior Type a b c Im still very... (3 Replies)
Discussion started by: radynaraya
3 Replies

8. Shell Programming and Scripting

awk - how to print specific field if a string is matched

hi gurus, I would like to be able to use awk to process 1 file as such: abc 1 2 3 4 5 6 7 8 9 10 flags 1 2 4 flags 1 2 5 abc 2 3 4 5 6 7 8 9 10 11 flags 1 2 3 abc 4 5 6 7 8 9 6 7 78 89 flags 1 2 3 flags 1 2 4 flags 1 2 3 4 I would like to be able to print field 1 and 5 when the... (4 Replies)
Discussion started by: revaroo
4 Replies

9. Shell Programming and Scripting

awk to print string if tag is specific value

In the below awk I am trying to print expName only if another tag planExecuted is true. In addition to the expName I am also printing planShortID. For some reason the word experiment gets printed so I remove it with sed. I have attached the complete index.html as well as included a sample of it... (1 Reply)
Discussion started by: cmccabe
1 Replies

10. UNIX for Beginners Questions & Answers

How to print multiple required columns dynamically in a file using the header name?

Hi All, i am trying to print required multiple columns dynamically from a fie. But i am able to print only one column at a time. i am new to shell script, please help me on this issue. i am using below script awk -v COLT=$1 ' NR==1 { for (i=1; i<=NF; i++) { ... (2 Replies)
Discussion started by: balu1234
2 Replies
skycoor(1)						      General Commands Manual							skycoor(1)

Name
       skycoor - Convert coordinates

Synopsis
       skycoor [-bdgjv] [-n ndec] ra1 dec1 sys1 ... ran decn sysn
       or
       skycoor [-vbjg] [-n ndec] @listfile

Description
       skycoor	converts  coordinates  between the J2000, B1950, and galactic coordinate systems, rounding to a specified number of decimal places
       and printing in degrees or hh:mm:ss.sss dd:mm:ss.sss.  Input coordinates may also be in either format, and the system (J2000, B1950, or ga-
       lactic) may be in upper or lower case.  No spaces are allowed within  the individual coordinates

Options
       -b     B1950 (FK4) output

       -d     RA and Dec output in degrees

       -e     Ecliptic longitude and latitude output

       -g     Galactic longitude and latitude output

       -i r|d|
	      Input units (r=radians, d=degrees, else hh:mm:sss dd:mm:sss)

       -j     J2000 (FK5) output

       -n <num>
	      Number of decimal places in output RA seconds

       -o <num>
	      Offset coordinates by this many arcseconds

       -p     RA and Dec proper motion in milliarcseconds/year

       -q     Output system, including equinox

       -r <RA> <Dec> <RA> <Dec>
	      Angular separation between two RA, Dec pairs

       -s     Output ra= dec= epoch= radecsys= for sethead

       -v     Print more intermediate information

       -w     Convert RA, Dec equatorial coordinates to x,y,z

       -x     Convert x,y,z equatorial coordinates to RA, Dec

       -y <epoch>
	      Epoch of coordinates in years

Author
       Doug Mink, SAO (dmink@cfa.harvard.edu)

9 November 2001 						     WCSTools								skycoor(1)
All times are GMT -4. The time now is 03:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy