Sponsored Content
Top Forums Shell Programming and Scripting Grep/Awk on 1st 2 Letters in 2nd Column of File Post 302727651 by TheNovice on Tuesday 6th of November 2012 02:41:59 PM
Old 11-06-2012
Hey guys. Thanks for the quick replies. I tried the suggestions below on the acutal file (~40000 entries) and, after cross checking the output with another source, I appeared to get the most accurate results with Guru's code (awk '$2 ~ /^CA/' file).

I'll be making note of all of the suggestions below for future reference, though.

Thanks again! You guys just saved me a bunch of time.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Awk+Grep Input file needs to match a column and print the entire line

I'm having problems since few days ago, and i'm not able to make it works with a simple awk+grep script (or other way to do this). For example, i have a input file1.txt: cat inputfile1.txt 218299910417 1172051195 1172070231 1172073514 1183135117 1183135118 1183135119 1281440202 ... (3 Replies)
Discussion started by: poliver
3 Replies

2. Shell Programming and Scripting

grep data on 2nd line and 3rd column

How do I grep/check the on-hand value on the second line of show_prod script below? In this case it's a "3". So if it's > 0, then run_this, otherwise, quit. > ./show_prod Product Status Onhand Price shoe OK 3 1.1 (6 Replies)
Discussion started by: joker_789us
6 Replies

3. UNIX for Dummies Questions & Answers

Grep /Awk letters X - X in every line and print it as a mac address

hey i m kinda new to this so i will appreciate any help , i have this list of values: pwwn = 0x50012482009cd7a7 nwwn=0x50012482009cd7a6 port_id = 0x280200 pwwn = 0x5001248201bcd7a7 nwwn=0x5001248201bcd7a6 port_id = 0x280300 pwwn = 0x50012482009c51ad nwwn=0x50012482009c51ac port_id =... (4 Replies)
Discussion started by: boaz733
4 Replies

4. UNIX for Dummies Questions & Answers

Grep.Need help with finding the words which start at [A-K] letters in thesecond column of the table

Hi buddies ! I need some help with one grep command :) I have this table: 1 Petras Pavardenis 1980 5 08 Linas Bajoriunas 1970 10 3 Saulius Matikaitis 1982 2 5 Mindaugas Stulgis 1990... (1 Reply)
Discussion started by: vaidastf
1 Replies

5. Shell Programming and Scripting

Calculate 2nd Column Based on 1st Column

Dear All, I have input file like this. input.txt CE2_12-15 3950.00 589221.0 9849709.0 768.0 CE2_12_2012 CE2_12-15 3949.00 589199.0 9849721.0 768.0 CE2_12_2012 CE2_12-15 3948.00 589178.0 9849734.0 768.0 CE2_12_2012 CE2_12-52 1157.00 ... (3 Replies)
Discussion started by: attila
3 Replies

6. Shell Programming and Scripting

How to awk or grep the last column in file when date on column contains spaces?

Hi have a large spreadsheet which has 4 columns APM00111803814 server_2 96085 Corp IT Desktop and Apps APM00111803814 server_2 96085 Corp IT Desktop and Apps APM00111803814 server_2 96034 Storage Mgmt Team APM00111803814 server_2 96152 GWP... (6 Replies)
Discussion started by: kieranfoley
6 Replies

7. UNIX for Dummies Questions & Answers

Grep -v value in 2nd column

Trying to do a grep -v on a value in the 2nd column of text. So if the word apple appears in a line in the 2nd column, it would not show up when the file was cat. Seems like a simple enough operation but I just can't figure it out. Any help would be appreciated. Thanks in advance. Are apples... (4 Replies)
Discussion started by: jimmyf
4 Replies

8. Linux

Print the 1st column and the value in 2nd or 3rd column if that is different from the values in 1st

I have file that looks like this, DIP-17571N|refseq:NP_651151 DIP-17460N|refseq:NP_511165|uniprotkb:P45890 DIP-17571N|refseq:NP_651151 DIP-19241N|refseq:NP_524261 DIP-19241N|refseq:NP_524261 DIP-17151N|refseq:NP_524316|uniprotkb:O16797 DIP-19588N|refseq:NP_731165 ... (2 Replies)
Discussion started by: Syeda Sumayya
2 Replies

9. UNIX for Beginners Questions & Answers

Compare 1st column from 2 file and if match print line from 1st file and append column 7 from 2nd

hi I have 2 file with more than 10 columns for both 1st file apple,0,0,0...... orange,1,2,3..... mango,2,4,5..... 2nd file apple,2,3,4,5,6,7... orange,2,3,4,5,6,8... watermerlon,2,3,4,5,6,abc... mango,5,6,7,4,6,def.... (1 Reply)
Discussion started by: tententen
1 Replies
WRITETYPE(1)						      General Commands Manual						      WRITETYPE(1)

NAME
WriteType - application designed to help students write more easily SYNOPSIS
writetype [OPTION] ... FILE DESCRIPTION
WriteType is a simple word processor designed to help young students write more easily and accurately. It offers spelling suggestions as students type, making the process easier and less frustrating. It also provides the ability to read back text through either an eSpeak or a Festival backend. In addition, there are special tools for teachers, and the entire application is easily translatable.1 WriteType is Free Software / Open Source, and is released under the GNU GPL license. OPTIONS
-l, --lang Set the language for this session -t, --tts-engine Set the tts engine for this session. Changes in the settings during this session will override this. -?, --help Display this help and exit FEATURES
Word Completion - As students type, word suggestions appear on the right-hand side of the screen to complete the word being typed. Click- ing on the desired word will finish the word. WriteType will also learn a student's habits over time and make more relevant suggestions based on what has already been written. Reading Back the Document - WriteType will read back written text, allowing students to catch errors they may not have caught reading it back themselves. Highlighting - Sections of the document can be quickly highlighted while typing or while listening to the document being read back. This lets students quickly flag areas they need to go back and review. Grammar checking - WriteType will underline simple grammar and formatting mistakes in the document, and offer to make the necessary revi- sion. Auto-correction - Common errors, such as typing isnt instead of isn't, will be corrected automatically without the need for intervention. Distraction-free mode If the typist has difficulty maintaining concentration while typing, distraction-free mode is an alternative inter- face that displays full screen and only includes the text box and the list of completions. Add a list of custom words In some situations, the default list of words is not sufficient, so the system allows the user to add new ones. Even if the words already exist in the list of words, adding them will bring them to the top of the list of suggestions. AUTHOR
WriteType was made by Max Shinn <max@bernsteinforpresident.com> SEE ALSO
You can find more information at http://writetype.bernsteinforpresident.com/ BUGS
Probably. 1.2.130 WRITETYPE(1)
All times are GMT -4. The time now is 01:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy