extract texts using awk


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting extract texts using awk
# 1  
Old 07-22-2011
extract texts using awk

Hello,
I have two files:

File1:
a
b
c
d

File2:
b
c
e

I need 'e' as output....

Thanks..

---------- Post updated at 12:16 PM ---------- Previous update was at 12:15 PM ----------

Basically I need the text from file2 that is not in file1
# 2  
Old 07-22-2011
Code:
comm -13 <(sort file1) <(sort file2)

This User Gave Thanks to bartus11 For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Aligning Texts

is there any way to align my text so every column begins on the same line as the previous line? here's my command: printf "THEN ( ${SEARCHPATTB} = Hour = ${CALTOTB} ) %8s => %8s NOW ( ${SEARCHPATT} = Hour = ${CALTOT} ) %7s => %7s Reduced By: %7s -${RESULT}"\\n output i'm currently getting... (2 Replies)
Discussion started by: SkySmart
2 Replies

2. Post Here to Contact Site Administrators and Moderators

Can there be alt-texts to icons?

Can you add hover texts (alt-texts) to icons? It is not always obvious what each of them mean just by looking at them. Sometimes it is clear from the url it points to, but for accessibility reasons alone it would be good to have alt-texts as a standard. (1 Reply)
Discussion started by: figaro
1 Replies

3. UNIX for Dummies Questions & Answers

Texts between 2 strings

Hi, I have a file with texts shown below, <2013 abc <2013 start request pdu dot1q end pdu response pdu dot1q end pdu am searching for the text "dot1q" , when it matches in the file , i need the contents between "<2013 start" and "end pdu". Can some one help on this ? ... (5 Replies)
Discussion started by: giri_luck
5 Replies

4. Programming

How to test many texts generated by many commands ?

Hello, I have hundreds of text files to be tested.They are generated by many commands. I should check whether a word in specific position is right, or whether a word in file A is equal to a word in file B. All the file are not the same. I decide to use shell to test every files, so I had to write... (7 Replies)
Discussion started by: 915086731
7 Replies

5. Shell Programming and Scripting

How to concatenate texts in perl only?

Hi, I want to concatenate the texts in the file but there are different scenario's. Ist Scenario. The contents of file has id`language,sequence number,text,language Here id`language is a key pair to identify the correct language. Sequnce number is the order the text being inserted. Text... (3 Replies)
Discussion started by: vanitham
3 Replies

6. Shell Programming and Scripting

copy and merge texts between two pattern

I need 1. to find all the files from a Folder "folder_name" and from its 4 or 5 sub folders which contain a certain pattern "pattern1". 2. from these files copy and merge all the text between "pattern1" and another different pattern "pattern2" to "mergefile". 3. Get rid of every html tag. 4.... (3 Replies)
Discussion started by: mjomba
3 Replies

7. Shell Programming and Scripting

Extract text between two specified "constant" texts using awk

Hi All, From the title you may know that this question has been asked several times and I have done lot of Googling on this. I have a Wikipedia dump file in XML format. All the contents are in one XML file i.e. all different topics have been put in one XML file. Now I need to separate them and... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

8. Shell Programming and Scripting

Two Huge Texts and Combine Result to Third

hi, i want to examine two file and write some codes to a third file. note that seperators are TAB, not space. first file: 192.168.1.1 3 192.168.1.2 2 192.168.3.2 2 192.168.7.3 1 ... second file: 192.168.1.1 1 10.15.1.1 3 30 10.15.2.1 2 40 192.168.1.1 2 10.23.4.5... (3 Replies)
Discussion started by: gc_sw
3 Replies
Login or Register to Ask a Question