Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Printing into two files under difference situation Post 302862105 by RudiC on Thursday 10th of October 2013 07:09:56 AM
Old 10-10-2013
You may also want to try this:
Code:
EXT=("YES" "NO")
for FN in *.gff
  do while read line
       do grep -Eqi "${line// /|}" name.txt
          echo "$line" >> ${FN%.gff}_${EXT[$?]}.gff
       done <"$FN"
  done

It depends on the two columns in *.gff being separated by one single blank only; if there's always and constantly three, try ${line// /|} for grep

Last edited by RudiC; 10-10-2013 at 03:33 PM.. Reason: pretty print
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

A Challenging situation for the MODERATORS

Well, I hope this way you will respond to my inquiries. I have 4 unix servers,with static ips (though i dont think this is an issue)....i can telnet and rlogin from one to the other....if i FTP from on et othe other and try to execute : cd /user return /user : no such file or... (1 Reply)
Discussion started by: BAM
1 Replies

2. UNIX for Advanced & Expert Users

current situation

hello..what is the current situation or lastest version of UNIX?? Is there any where i can read more about it?? (2 Replies)
Discussion started by: joanne6298
2 Replies

3. Shell Programming and Scripting

sed situation

Hi, I'm looking for someone who can think in sed. Basically, I need the trailing characters on every line in a file to be deleted. These characters are all in capitals, and always follow a number, but they often vary in number For instance, on the line: 2006_10_9_p20_TALK I'd want to... (4 Replies)
Discussion started by: Laurel Maury
4 Replies

4. Programming

strange situation in file

Hi All, I am writing some data's into a file from C++ program. The files which i am writing is of fixed length . say 232 in length per line. I am writing as . my c code is as ... (0 Replies)
Discussion started by: arunkumar_mca
0 Replies

5. UNIX for Dummies Questions & Answers

help : crisis situation !!

Hi I had deleted important files from my company server :( the server is HPUX and i don't know how to undo rm command or how to restore the files .. iam appreciate for any help Thanx ... (5 Replies)
Discussion started by: Eisa
5 Replies

6. Shell Programming and Scripting

Comparing Columns and printing the difference from a particular file

Gurus, I have one file which is having multiple columns and also this file is not always contain the exact columns; sometimes it contains 5 columns or 12 columns. Now, I need to find the difference from that particular file. Here is the sample file: param1 | 10 | 20 | 30 | param2 | 10 |... (6 Replies)
Discussion started by: buzzusa
6 Replies

7. Shell Programming and Scripting

Columns comparision of two large size files and printing the difference

Hi Experts, My requirement is to compare the second field/column in two files, if the second column is same in both the files then compare the first field. If the first is not matching then print the first and second fields of both the files. first file (a .txt) < 1210018971FF0000,... (6 Replies)
Discussion started by: krao
6 Replies

8. Shell Programming and Scripting

Cat files situation

Hello, I am PhD student (Biomedical sciences) and very new to Linux. I need some help with the following task : I have files in the following format for their names : An_A1_nnn_R1.txt; An_A1_nnm_R1.txt; An_A1_nnoo_R1.txt An_A2_nnn_R1.txt; An_A2_nnm_R1.txt; An_A2_nno_R1.txt ... (8 Replies)
Discussion started by: Julio Finalet
8 Replies

9. Shell Programming and Scripting

Compare line and printing difference

Hi, I want to compare two files and print out their differences e.g: t1.txt a,b,c,d t2.txt a,b,c,d,e,f Output e,f Currently I do this long about way tr ',' '\n' <t1.txt >t1.tmp tr ',' '\n' <t2.txt >t2.tmp diff t1.tmp t2.tmp > t12.tmp I have to this comparison for 100 files, so... (3 Replies)
Discussion started by: wahi80
3 Replies

10. UNIX for Beginners Questions & Answers

Comparing two files and list the difference with common first line content of both files

I have two file as given below which shows the ACL permissions of each file. I need to compare the source file with target file and list down the difference as specified below in required output. Can someone help me on this ? Source File ************* # file: /local/test_1 # owner: own #... (4 Replies)
Discussion started by: sarathy_a35
4 Replies
wml::std::href(3)						     EN Tools							 wml::std::href(3)

NAME
wml::std::href - Enhanced Hyperlink SYNOPSIS
#use wml::std::href <href url="..." [name="..."] [image="..."] [hint="..."] [target="..."]> DESCRIPTION
This is an interface to the standard HTML anchor tag ("<a href="...">...</a>"). The intended use of "<href>" is to simplify the creation of hyperlinks. The following <href url="THE://URL"> <href url="THE://URL" name="THE_NAME"> <href url="THE://URL" image="THE_IMG.EXT"> <href url="THE://URL" name="THE_NAME" image="THE_IMG.EXT"> <href url="THE://URL" hint="THE_HINT"> <href url="THE://URL" name="THE_NAME" image="THE_IMG.EXT" hint="THE_HINT"> gets expanded to <a href="THE://URL"><tt>THE://URL</tt></a> <a href="THE://URL">THE_NAME</a> <a href="THE://URL"><img src="THE_IMG.EXT" alt="THE://URL" border="0"></a> <a href="THE://URL"><img src="THE_IMG.EXT" alt="THE_NAME" border="0"></a> <a href="THE://URL" onmouseover="self.status='THE_HINT';return true" onmouseout="self.status='';return true" onfocus="self.status='THE_HINT';return true" onblur="self.status='';return true"><tt>THE://URL</tt></a> <a href="THE://URL" onmouseover="self.status='THE_HINT';return true" onmouseout="self.status='';return true" onfocus="self.status='THE_HINT';return true" onblur="self.status='';return true"><img src="THE_IMG.EXT" alt="THE_NAME" border="0"></a> AUTHOR
Ralf S. Engelschall rse@engelschall.com www.engelschall.com REQUIRES
Internal: P1, P2 External: -- SEE ALSO
HTML "<a>" and "<img>" tags. EN Tools 2014-04-16 wml::std::href(3)
All times are GMT -4. The time now is 03:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy