I have two files as below
A file
B file
I hope output file as below
Condition looks like
1. All comment lines in A file will output
2. if same comment line in B file, line below that comment line in B file will output
3. if no same comment line in B file, line below comment line in A file will output
I have created these files in a particular directory
a_1.txt
a_2.txt
...
..
a_n.txt
Each file has a single line.
I want to write a output file a.txt, which will have concantated value of string from all the files.
which utility should i use. copy, cat or paste????
Can anyone help... (5 Replies)
I have two files, each of them has 12 lines, fileA has 3 columns, fileB has 1 column, like the following
FileA
a 1
b 2
c 3
..blabla
FileB
A
B
C
..blabla
Now I am trying to put the content of fileB as column 3 of fileA, e.g.
a 1 A
b 2 B
c 3 C (3 Replies)
hi,
i am facing a problem in merging two files using awk,
the problem is as stated below,
file1:
A|B|C|D|E|F|G|H|I|1
M|N|O|P|Q|R|S|T|U|2
AA|BB|CC|DD|EE|FF|GG|HH|II|1
....
....
....
file2 :
1|Mn|op|qr (2 Replies)
hi
i have two files
file1
1234567
1234678
1234679
file2
98765|jjkskk|9393|iyutr
98765|kkooo|9393|hjjjd
98765|abcvfg|9393|sskds
output should be
1234567|jjkskk|9393|iyutr
1234678|kkooo|9393|hjjjd
1234679|abcvfg|9393|sskds (5 Replies)
Hello,
i'd like a bash script to merge 2 files without duplicate lines.
Example :
file1 :
toto
titi
file2 :
toto
tata
Expected result, file3 :
toto (5 Replies)
Hi,
I would like to know how can I merge files based on their coordinates, but mantaining the score of each file in the output file like:
Note: 1st column is for chromosome, 2nd for start, 3rd for end of segment, 4th for score
file1:
1 200 300 20
1 400 500 30
file2:
1 200 350 30
1... (1 Reply)
Hi,
My requirement is,there is a directory location like:
:camp/current/
In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Dear Gents,
Please I need your help... I need small script :) to do the following.
I have a thousand of files in a folder produced daily.
I need first to merge all files called. txt (0009.txt, 0010.txt, 0011.txt) and and to output a resume of all information on 2 separate files in csv... (14 Replies)
Discussion started by: jiam912
14 Replies
LEARN ABOUT DEBIAN
thread::pool::simple
Simple(3pm) User Contributed Perl Documentation Simple(3pm)NAME
Thread::Pool::Simple - A simple thread-pool implementation
SYNOPSIS
use Thread::Pool::Simple;
my $pool = Thread::Pool::Simple->new(
min => 3, # at least 3 workers
max => 5, # at most 5 workers
load => 10, # increase worker if on average every worker has 10 jobs waiting
init => [&init_handle, $arg1, $arg2, ...] # run before creating worker thread
pre => [&pre_handle, $arg1, $arg2, ...] # run after creating worker thread
do => [&do_handle, $arg1, $arg2, ...] # job handler for each worker
post => [&post_handle, $arg1, $arg2, ...] # run before worker threads end
passid => 1, # whether to pass the job id as the first argument to the &do_handle
lifespan => 10000, # total jobs handled by each worker
);
my ($id1) = $pool->add(@arg1); # call in list context
my $id2 = $pool->add(@arg2); # call in scalar conetxt
$pool->add(@arg3) # call in void context
my @ret = $pool->remove($id1); # get result (block)
my $ret = $pool->remove_nb($id2); # get result (no block)
$pool->cancel($id1); # cancel the job
$pool->cancel_all(); # cancel all jobs
$pool->join(); # wait till all jobs are done
$pool->detach(); # don't wait.
DESCRIPTION
"Thread::Pool::Simple" provides a simple thread-pool implementaion without external dependencies outside core modules.
Jobs can be submitted to and handled by multi-threaded `workers' managed by the pool.
AUTHOR
Jianyuan Wu, <jwu@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2007 by Jianyuan Wu
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2010-10-04 Simple(3pm)