find the string in the 55th column [awk]


 
Thread Tools Search this Thread
Operating Systems Solaris find the string in the 55th column [awk]
# 1  
Old 09-24-2008
find the string in the 55th column [awk]

hi people,

i need a help!!!!

i'm trying use a awk command, but i dont have success!..

i need find the string 'FL' in 55th column in a length file of 2.4Gb!!!

Attempts:
awk -F"\t" ' { if ($55 ~ /^F/) print $0} ' FILE
awk -F"\t" ' { if ($55 ~ /FL/) print $0} ' FILE
awk -F"\t" ' { if ($55 ~ /F$/) print $0} ' FILE




AWK ???

!sorry for my english!
# 2  
Old 09-24-2008
Try using nawk vs awk.
# 3  
Old 09-24-2008
use this code :
------------------------------------------
awk '/FL/ {if ($55=="FL") print $0}' file
------------------------------------------
# 4  
Old 09-24-2008
Quote:
Originally Posted by RahulJoshi
use this code :
------------------------------------------
awk '/FL/ {if ($55=="FL") print $0}' file
------------------------------------------
this command returns all contains 'FL' and ignore column 55th!!
# 5  
Old 09-24-2008
MySQL

i got so:

nawk -F"\t" ' { if ($55 ~ /FL/) print $0} ' FILE 1>exit.txt 2>exit.txt
# 6  
Old 09-24-2008
fyi... nawk can significantly decrease the time it takes to run your script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to find string based on pattern and search for its corresponding rows in column

Experts, Need your support for this awk script. we have only one input file, all these column 1 and column 2 are in same file and have to do lookup for values in one file(column1 and column2) but output we need in another file Need to grep row whose string contains 9K from column 1. When found... (6 Replies)
Discussion started by: as7951
6 Replies

2. Shell Programming and Scripting

awk to find maximum and minimum from column and store in other column

Need your support for below. Please help to get required output If column 5 is INV then only consider column1 and take out duplicates/identical rows/values from column1 and then put minimum value of column6 in column7 and put maximum value in column 8 and then need to do subtract values of... (7 Replies)
Discussion started by: as7951
7 Replies

3. Shell Programming and Scripting

awk find which column contains string

i want to search columns in a variable and any column contains a particular string, i want to print the value of that column $ echo "${USEDMEMORY}" memTotalReal=3925908 memAvailReal=1109812 memBuffer=242676 memCached=641628 $ $ echo "${USEDMEMORY}" | awk '/memAvailReal/' so what im trying... (6 Replies)
Discussion started by: SkySmart
6 Replies

4. Shell Programming and Scripting

Count occurrence of string in a column using awk

Hi, I want to count the occurrences of strings in a column and display as in example below: Input: get1 345 789 098 get2 567 982 090 fet4 777 610 632 get1 800 544 230 get1 600 788 451 get2 892 321 243 get1 673 111 235 fet3 789 220 278 fet4 768 222 341 output: 4 get1 345 789... (7 Replies)
Discussion started by: aydj
7 Replies

5. Shell Programming and Scripting

Column string matching in awk

Hello, I want pick up rows from input with conditions: 1) col2 is 2 replicate of col1 joint with "/" 2) col3 is a joint string as replicate of each side of the "/" symbol 3) col2 not equal to col3 input: TG TG/TG TG/TGG C C/C C/CG C C/G CA/CA C C/C CA/CA AG AG/AG... (3 Replies)
Discussion started by: yifangt
3 Replies

6. Shell Programming and Scripting

Find String and add to next column

Dear All, I have file input input01.txt 14193 40 153 14208 40 168 14283 45 243 14298 40 258 14313 41 273 14328 44 288 ... ...input02.txt 499815.5 9886300.0 14208 94.2 1957.1 499815.5 9886300.0 14208 314.2 2101.0 ... (2 Replies)
Discussion started by: attila
2 Replies

7. Emergency UNIX and Linux Support

awk cut column based on string

Using awk I required to cut out column contain word "-Tag" regardles of any order of contents and case INsensitive -Tag:messages -P:/var/log/messages -P:/var/log/maillog -K:Error -K:Warning -K:critical Please Guide ...... --Shirish Shukla ---------- Post updated at 05:58 AM... (15 Replies)
Discussion started by: Shirishlnx
15 Replies

8. Shell Programming and Scripting

Awk - find string, search lines below string for other strings

What's the easiest way to search a file for a specific string and then look for other instances after that? I want to search for all Virtual Hosts and print out the Server Name and Document Root (if it has that info), while discarding the rest of the info. Basically my file looks like this: ...... (6 Replies)
Discussion started by: Mbohmer
6 Replies

9. Shell Programming and Scripting

find expression with awk in only one column, and if it fits, print whole column

Hi. How do I find an expression with awk in only one column, and if it fits, then print that whole column. 1 apple oranges 2 bannanas pears 3 cats dogs 4 hesaid shesaid echo "which number:" read NUMBER (user inputs number 2 for this example) awk " /$NUMBER/ {field to search is field... (2 Replies)
Discussion started by: glev2005
2 Replies

10. UNIX for Dummies Questions & Answers

find the string in the 55th column [awk]

hi people, i need a help!!!! i'm trying use a awk command, but i dont have success!.. i need find the string 'FL' in 55th column in a length file of 2.4Gb!!! Attempts: awk -F"\t" ' { if ($55 ~ /^F/) print $0} ' FILE awk -F"\t" ' { if ($55 ~ /FL/) print $0} ' FILE awk -F"\t" ' { if... (7 Replies)
Discussion started by: gandarez
7 Replies
Login or Register to Ask a Question