I have two files.
File1
File2
For all lines in file1, I want to match the term bracked by "gb|" and "." (i.e. AF197889 in the first line) to a line in file2. In this example of file1, all terms of interest start with "AF" but this isn't always the case.
If there's a match, I'd like to append the species name in file2, preceded by "_host_" to the matching line in file1, using underscores and no spaces. Desired output:
With the meager skills I have, I could use "|" as a filed separator for file 1 and use awk to fill an array to find matches. But I'm not sure how to to append the file2 data, or how to accomplish it in one step. Can anyone help?
Last edited by Don Cragun; 08-18-2013 at 02:56 PM..
Reason: CODE tags; not QUOTE tags for input, output, and code samples.
I have a file that contains 87 lines, each with a set of coordinates (x & y). This file looks like:
1 200.3 -0.3
2 201.7 -0.32
...
87 200.2 -0.314
I have another file which contains data that was taken at certain of these 87 positions. i.e.:
37 125
42 175
86 142
where the first... (1 Reply)
Hi All,
I am trying to join to files based on one common column.
Cat File1
ID HID
Ab_1 23
Cd 45
df 22
Vv 33
Cat File2
ID pval
Ab_1 0.3
Cd 10
Vv 0.0444 (3 Replies)
Hello,
Could someone help me with sed. I have searched for solution 5 days allready :wall:, but cant find. Unfortunately my "sed" knowledge not good enough to manage it. I have the text:
123, foo1, bar1, short text1, dat1e, stable_pattern
124, foo2, bar2, long text
with few
lines, date,... (4 Replies)
hi
i have a file with the following lines
2303:13593:137135 16 abc1 26213806.......
1234:45675:123456 16 bbc1 9813806.......
2303:13593:137135 17 bna1 26566444....
1234:45675:123456 18 nnb1 98123456.......
i want to join the lines having common 1st field i,e.,
... (1 Reply)
Hi,
I have a data file where data is splitted into multiple lines. And, each valid record starts with a patten date | <?xml and ends with pattern </dmm>
e.g.
20120924|<?xml record 1 line1....record 1 line1....record 1 line1....
record 1 line2....record 1 line2....record 1 line2....
record 1... (3 Replies)
I am trying to merge two lines to one based on some matching condition.
The file is as follows:
Matches filter:
'request ', timestamp, <HTTPFlow
request=<GET:
Matches filter:
'request ', timestamp, <HTTPFlow
request=<GET:
Matches filter:
'request ', timestamp, <HTTPFlow
... (8 Replies)
Hello ,
I will need your help once again.
I have the following file:
cat file02.txt
PATTERN XXX.YYY.ZZZ. 500
ROW01 aaa. 300 XS 14
ROW 45 29 AS XD.FD.
PATTERN 500 ZZYN002
ROW gdf gsste
ALT 267 fhhfe.ddgdg.
PATTERN ERE.MAY. 280
PATTERRNTH 5000 rt.rt.
ROW SO a 678
PATTERN... (2 Replies)
Hello,
I have a file with 2 columns ( tableName , ColumnName) delimited by a Pipe like below . File is sorted by ColumnName.
Table1|Column1
Table2|Column1
Table5|Column1
Table3|Column2
Table2|Column2
Table4|Column3
Table2|Column3
Table2|Column4
Table5|Column4
Table2|Column5
From... (6 Replies)
Hi,
i have 2 files , the data i need to match is in masterfile and i need to pull out column 3 from master if column 1 and 2 match and output entire row to new file
I have tried with join and awk and i keep getting blank outputs or same file
is there an easier way than what i am... (4 Replies)