SEQanswers

Go Back   SEQanswers > General



Similar Threads
Thread Thread Starter Forum Replies Last Post
Cufflinks/cuffmerge text file busy error gormleymp RNA Sequencing 11 04-03-2013 07:05 AM
convert a text file in fasta with decollpasing Giorgio C Bioinformatics 3 03-29-2013 10:48 AM
Text file editing_perl-GFF bioman1 Bioinformatics 0 07-05-2012 08:47 AM
Question about editing a tabbed text file.. shyam_la Bioinformatics 24 06-14-2012 09:06 PM
Save error report as text file in BWA CNVboy Bioinformatics 0 06-27-2011 03:03 PM

Reply
 
Thread Tools
Old 06-20-2015, 04:18 AM   #1
Liy
Member
 
Location: Hungary

Join Date: Feb 2012
Posts: 19
Default text file editing

Dear all,

I have a problem that i cannot solve and I hope someone here can help me.

I have two text files with one column of values.
Example:

File1:
67
94
95
.
.

File2
0.1
0.003
0.5
.
.

File1 contains the row numbers that value I need from File2. For example the output should be like this:

Theoretical outfile:
0.4 (row 67 from File2)
0.5 (row 94 from File2)
0.1 (row 95 from File2)
etc...

Is it possible to do this with awk?

I would really appritiate if someone can help me.

Thanks,
Liy
Liy is offline   Reply With Quote
Old 06-20-2015, 12:29 PM   #2
Liy
Member
 
Location: Hungary

Join Date: Feb 2012
Posts: 19
Default

solved

awk 'FNR==NR{A[NR]=$0;next} ($0 in A){print A[$0]}' file2 file1
Liy is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 01:29 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO