Sponsored Content
Top Forums Shell Programming and Scripting Merge two file data together based on specific pattern match Post 302373986 by patrick87 on Monday 23rd of November 2009 04:57:34 AM
Old 11-23-2009
Does anybody got idea to archive this goal?!
My input:
File_1:
2000_t
g1110.b1
abb.1
2001_t
g1111.b1
abb.2
abb.2
g1112.b1
abb.3
2002_t
.
.

File_2:
2000_t Ali england 135
abb.1 Zoe british 150
2001_t Ali england 305
g1111.b1 Lucy russia 126
abb.2 Zoe british 500
abb.2
g1112.b1 Lucy russia 180
abb.3 Zoe british 700
.
.

My desired output file:
2000_t Ali england 135
g1110.b1
abb.1 Zoe british 150
2001_t Ali england 305
g1111.b1 Lucy russia 126
abb.2 Zoe british 500
abb.2
g1112.b1 Lucy russia 180
abb.3 Zoe british 700
2002_t
.
.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenating and appending string based on specific pattern match

Input #GEO-1-type-1-fwd-Initial 890 1519 OPKHIJEFVTEFVHIJEFVOPKHIJTOPKEFVHIJTEFVOPKOPKHIJHIJHIJTTOPKHIJHIJEFVEFVOPKHIJOPKHIJOPKEFVEFVOPKHIJHIJEFVHIJHIJEFVTHIJOPKOPKTEFVEFVEFVOPKHIJOPKOPKHIJTTEFVEFVTEFV #GEO-1-type-2-fwd-Terminal 1572 2030... (7 Replies)
Discussion started by: patrick87
7 Replies

2. Shell Programming and Scripting

Paste two file side by side together based on specific pattern match problem

Input file_1: P78811 P40108 O17861 Q6NTW1 P40986 Q6PBK1 P38264 Q6PBK1 Q9CZ49 Q1GZI0 Input file_2: (6 Replies)
Discussion started by: patrick87
6 Replies

3. Shell Programming and Scripting

Merge lines in text file based on pattern

Hello, I have searched forum trying to find a solution to my problem, but could not find anything or I did not understand the examples.... I should say, I am very inexperienced with text processing. I have a text file with approx 60k lines in it. I need to merge lines based on the number... (8 Replies)
Discussion started by: Bertik
8 Replies

4. Shell Programming and Scripting

fetch last line no form file which is match with specific pattern by grep command

Hi i have a file which have a pattern like this Nov 10 session closed Nov 10 Nov 9 08:14:27 EST5EDT 2010 on tty . Nov 10 Oct 19 02:14:21 EST5EDT 2010 on pts/tk . Nov 10 afrtetryytr Nov 10 session closed Nov 10 Nov 10 03:21:04 EST5EDT 2010 Dec 8 Nov 10 05:03:02 EST5EDT 2010 ... (13 Replies)
Discussion started by: Himanshu_soni
13 Replies

5. Shell Programming and Scripting

Help with replace line based on specific pattern match

Input file data20714 7327 7366 detail data20714 7327 7366 main data250821 56532 57634 detail data250821 57527 57634 main data250821 57359 57474 main data250821 57212 57301 main data250821 57140 57159 detail data250821 56834 57082 main data250821 56708 56779 main ... (3 Replies)
Discussion started by: perl_beginner
3 Replies

6. Shell Programming and Scripting

Help with ksh-to read ip file & append lines to another file based on pattern match

Hi, I need help with this- input.txt : L B white X Y white A B brown M Y black Read this input file and if 3rd column is "white", then add specific lines to another file insert.txt. If 3rd column is brown, add different set of lines to insert.txt, and so on. For example, the given... (6 Replies)
Discussion started by: prashob123
6 Replies

7. Shell Programming and Scripting

How to merge variable data from another file into specific place?

Hello, I'm trying to create multiple commands using a variable input from another file but am not getting any successful results. Basically, file1.txt contains multiple lines with single words: <file1.txt> yellow blue black white I want to create multiple echo commands with these... (8 Replies)
Discussion started by: demmel
8 Replies

8. Shell Programming and Scripting

Match all lines in file where specific text pattern is less than

In the below file I am trying to grep or similar, all lines where only AF= is less than 0.4.. Thank you :). grep grep "AF=" ,+ .4 file file 12 112036782 . T C 34.0248 PASS ... (3 Replies)
Discussion started by: cmccabe
3 Replies

9. Shell Programming and Scripting

awk to update value based on pattern match in another file

In the awk, thanks you @RavinderSingh13, for the help in below, hopefully it is close as I am trying to update the value in $12 of the tab-delimeted file2 with the matching value in $1 of the space delimeted file1. I have added comments for each line as well. Thank you :). awk awk '$12 ==... (10 Replies)
Discussion started by: cmccabe
10 Replies

10. Shell Programming and Scripting

Bash to move specific files to directory based on match to file

I am trying to mv each of the .vcf files in the variants folder to the folder in /home/cmccabe/f2 that the .vcf id is found in file. $2 in file will always have the id of a .vcf in the variants folder. The line in blue staring with R_2019 in file up to the -v5.6 will always be an exact match to a... (4 Replies)
Discussion started by: cmccabe
4 Replies
mpdcron(1)						      General Commands Manual							mpdcron(1)

NAME
mpdcron - cron like daemon for mpd SYNOPSIS
mpdcron [option] DESCRIPTION
mpdcron is a cron like daemon for mpd. It connects to mpd, waits for idle events. It has two interfaces: o Hooks which are executed after setting environment variables which hooks can use to get more information about the event without having to connect to mpd. o Modules, which are dynamically loaded and have direct access to mpd connection and the file descriptor of mpdcron's configuration file. By default it will get the host name and port for mpd from MPD_HOST and MPD_PORT environment variables. MPD_PASSWORD environment variable can be set to make mpdcron connect to a password-protected mpd. If these environment variables aren't set, mpdcron connects to localhost on port 6600. OPTIONS
-?, --help Show help options and exit. -V, --version Print version information and exit. -k, --kill Instead of launching the daemon, attempt to kill the already running daemon. -n, --no-daemon Don't detach from console. This option can be used for debugging. FILES
o ~/.mpdcron/mpdcron.conf User configuration file SEE ALSO
o mpd(1) o <http://alip.github.com/mpdcron/> REPORTING BUGS
If you find a bug, please report it at <http://github.com/alip/mpdcron/issues> COPYRIGHT
Copyright (c) 2009 Ali Polatel <alip@exherbo.org> Free use of this software is granted under the terms of the GNU General Public License (GPL). AUTHOR
Ali Polatel <alip@exherbo.org> manual December 23, 2009 mpdcron(1)
All times are GMT -4. The time now is 09:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy