02-09-2014
[Solved] Matching and transposing
Hi,
I've got two files.
files one:
HTML Code:
AAMP 2:219129783:A:G
AAMP 2:219129896:A:G
AAMP 2:219130802:T:C
AANAT 17:74464865:T:G
AANAT 17:74464914:A:G
AANAT 17:74464920:T:C
file 2:
I need to create the following file:
HTML Code:
AAMP 2:219129783:A:G 2:219129896:A:G 2:219130802:T:C
AANAT 17:74464865:T:G 17:74464914:A:G 17:74464920:T:C
[
Basically, the first column of file one is matched to first column of file two and all the lines of file one matching column one in file 2 are then transposed and printed in one line, next to the first column of file two.
I am afraid my awk knowledge is not enough to solve this one.
If anyone can offer a solution, I would very very grateful!!!!
Many thanks for your time and help in advance!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, I've written a shell function in bash that reads letters into an array, then outputs them in one column with:
for n in "${array}"; do
echo $n
done
I was wondering if anyone knew how i would transpose the letters that are output by the for loop. Right now my output is:
aabbcc... (4 Replies)
Discussion started by: myscsa2004
4 Replies
2. Shell Programming and Scripting
Hello,
Is there a way to transpose a file in shell scripting? For instance, from
a1 a2 a3 a4 a5 a6 a7 ....
b1 b2 b3 b4 b5 b6 b7 ....
c1 c2 c3 c4 c5 c6 c7 ....
d1 d2 d3 d4 d5 d6 d7 ...
...
...
...
to
a1 b1 c1 d1 ....
a2 b2 c2 d2 ....
a3 b3 c3 d3 ....
a4 b3 c3 d4 ....
...
... (24 Replies)
Discussion started by: mskcc
24 Replies
3. Shell Programming and Scripting
Hello
I need to sort a file with data such as so it breaks on column 1 and all the data in column 2 is sorted into rows with a unique column 1:
1 5
1 6
1 7
2 3
2 4
3 7
3 0
3 9
So it comes out as:
1 5 6 7
2 3 4
3 7 0 9
I've tried many iterations of nawk but can't get it... (14 Replies)
Discussion started by: stevesmith
14 Replies
4. Shell Programming and Scripting
Hello guys,
can some please give driection as to how to archieve this big issue i am having:
I a random number that has been generated and wants the user to guess it, let me illustrate this:
say the random i hve generated is 'nice'
- i then hide it from the user and display it in ----... (3 Replies)
Discussion started by: unibboy
3 Replies
5. UNIX Desktop Questions & Answers
Hi everyone,
I have a poblem like that:
I have a file which includes data looks like:
0.65214 0.3597 1.0
0.65244 0.3502 1.0
0.65273 0.3553 1.0
0.65305 0.3544 1.0
0.65327 0.3505 1.0
0.65359 0.3516 1.0
0.65578 0.6464 1.0
0.65605 0.6453 1.0
0.65633 0.6437 1.0
0.65660 0.6488 1.0... (3 Replies)
Discussion started by: bulash
3 Replies
6. Shell Programming and Scripting
i have a file as:
1
2
3
4
5
i want output as :
1 2 3 4 5
can anybody help on this?? (14 Replies)
Discussion started by: vikas_kesarwani
14 Replies
7. Shell Programming and Scripting
Hi All,
I have a input file say FILEA.
FILEA
--------
empid1
sal1
location1
manager1
empid2
sal2
location2
manager2
empid3
sal3
location3
manager3
.
.
. (3 Replies)
Discussion started by: 46019
3 Replies
8. Emergency UNIX and Linux Support
Hi,
I have an input file like
F : 0.1 : 0.002
P : 0.3 : 0.004
P : 0.5 : 0.008
P : 0.1 : 0.005
L : 0.05 : 0.02
P: 0.1 : 0.006
P : 0.01 : 0.08
F : 0.02 : 0.08
Expected output: (2 Replies)
Discussion started by: vasanth.vadalur
2 Replies
9. Shell Programming and Scripting
Hi Guys,
I have file containing this kind of format below:
======== MOBILITY EVENT (G): ATTACH REJECT =========
Time : <date_time>
Node : <node>
GMM Cause : <code>
Details : <details>
Attach : <attach type>
IMSI : <imsi>
PTMSI : <ptmsi>
RA New : <ra new>
RA... (9 Replies)
Discussion started by: rymnd_12345
9 Replies
10. UNIX for Dummies Questions & Answers
Hi Folks,
I have two arrays
a:
aaa bbb ccc ddd
ddd aaa bbb ccc
ddd ccc aaa bbb
b:
aaa bbb ccc
aaa ccc bbb
bbb aaa ccc
ccc bbb aaa
I want to compare row by row a(c1:c4) to b(c1:c3). If elements of 'b' match... (5 Replies)
Discussion started by: heecha
5 Replies
LEARN ABOUT MOJAVE
html::formattext5.18
HTML::FormatText(3) User Contributed Perl Documentation HTML::FormatText(3)
NAME
HTML::FormatText - Format HTML as plaintext
VERSION
version 2.11
SYNOPSIS
use HTML::TreeBuilder;
$tree = HTML::TreeBuilder->new->parse_file("test.html");
use HTML::FormatText;
$formatter = HTML::FormatText->new(leftmargin => 0, rightmargin => 50);
print $formatter->format($tree);
or, more simply:
use HTML::FormatText;
my $string = HTML::FormatText->format_file(
'test.html',
leftmargin => 0, rightmargin => 50
);
DESCRIPTION
HTML::FormatText is a formatter that outputs plain latin1 text. All character attributes (bold/italic/underline) are ignored. Formatting of
HTML tables and forms is not implemented.
HTML::FormatText is built on HTML::Formatter and documentation for that module applies to this - especially "new" in HTML::Formatter,
"format_file" in HTML::Formatter and "format_string" in HTML::Formatter.
You might specify the following parameters when constructing the formatter:
leftmargin (alias lm)
The column of the left margin. The default is 3.
rightmargin (alias rm)
The column of the right margin. The default is 72.
SEE ALSO
HTML::Formatter
INSTALLATION
See perlmodinstall for information and options on installing Perl modules.
BUGS AND LIMITATIONS
You can make new bug reports, and view existing ones, through the web interface at
<http://rt.cpan.org/Public/Dist/Display.html?Name=HTML-Format>.
AVAILABILITY
The project homepage is <https://metacpan.org/release/HTML-Format>.
The latest version of this module is available from the Comprehensive Perl Archive Network (CPAN). Visit <http://www.perl.com/CPAN/> to
find a CPAN site near you, or see <https://metacpan.org/module/HTML::Format/>.
AUTHORS
o Nigel Metheringham <nigelm@cpan.org>
o Sean M Burke <sburke@cpan.org>
o Gisle Aas <gisle@ActiveState.com>
COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Nigel Metheringham, 2002-2005 Sean M Burke, 1999-2002 Gisle Aas.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.18.2 2017-10-06 HTML::FormatText(3)