Merge multiple lines in same file with common key using awk
I've been a Unix admin for nearly 30 years and never learned AWK. I've seen several similar posts here, but haven't been able to adapt the answers to my situation. AWK is so damn cryptic!
I have a single file with ~900 lines (CSV list). Each line starts with an ID, but with different stuff after it which I want to merge onto a single line. Sometimes there are just a couple of lines to be merge, sometimes there are 4 or 5. The input file is already sorted.
Here's an example:
Output should look like:
---------- Post updated at 12:22 AM ---------- Previous update was at 12:11 AM ----------
I forgot to mention, each line in the input file only has 4 fields.
Hi,
I have a tab delimited flat file like this: 189 Guide de lutilisateur sur lappel conférence à trois au moyen d'adaptateurs téléphoniques <TABLE><TBODY><TR><TD><DIV class=subheader>La fonction Appel conférence à trois </DIV></TD>
\
<TD><?php print $navTree;?> vous permet de tenir un appel... (4 Replies)
I've hunted and hunted but nothing seems to apply to what I need. Any help will be much appreciated!
My input file looks like (Unix):
marker,allele1,allele2
RS1002244,1,1
RS1002244,1,3
RS1002244,3,3
RS1003719,2,2
RS1003719,2,4
RS1003719,4,4
Most markers are listed 3 times but a few... (2 Replies)
Hi All,
I have working (Perl) code to combine 2 input files into a single output file using the join function that works to a point, but has the following limitations:
1. I am restrained to 2 input files only.
2. Only the "matched" fields are written out to the "matched" output file and... (1 Reply)
Hi Guys,
After windows died on my netbook I installed Lubuntu and discovered Gawk about a month ago. After using Excel for 10+ years I'm amazed how quick and easily Gawk can process data but I'm stuck with a little problem merging data from multiple lines.
I'm an SEO Consultant and provide... (9 Replies)
I have 100 data files labelled 250.1.txt through 250.100.txt. The second column of the data files partially match (there is about %90 overlap). Each data file has 4 columns.
I want the merge all these text files by the matching values in the second column. In the output, the first column should... (1 Reply)
Hi all,
Say i have multiple files x1 x2 x3 x4, all with common header (date, time, year, age),,
How can I merge them to one singe file "X" in shell scripting
Thanks for your suggestions. (2 Replies)
Hi, I am trying to selectively merge two files based on keys reported in the 1st column.
File1:
#file1-header1
file1-header2
111 qwe rtz uio
198 asd fgh jkl
165 yxc
789 poi uzt rew
89 lkj
File2:
#file2-header2
file2-header2
165 ghz nko2 ... (2 Replies)
Join and merge multiple files with duplicate key and fill void columns
Hi guys,
I have many files that I want to merge:
file1.csv:
1|abc
1|def
2|ghi
2|jkl
3|mno
3|pqr
file2.csv: (5 Replies)
Discussion started by: yjacknewton
5 Replies
LEARN ABOUT OSX
svk::merge::info
SVK::Merge::Info(3) User Contributed Perl Documentation SVK::Merge::Info(3)NAME
SVK::Merge::Info - Container for merge ticket information
SYNOPSIS
use SVK::Merge::Info;
my $minfo = SVK::Merge::Info->new( $svk_merge_property );
DESCRIPTION
An "SVK::Merge::Info" object represents a collection of merge tickets, including repository UUID, path and revision.
CONSTRUCTORS
new
Takes a single argument with the value of an "svk:merge" property.
METHODS
add_target
Add a single SVK::Target::Universal or SVK::Path to the collection of merge tickets.
del_target
Remove a single SVK::Target::Universal or SVK::Path from the collection of merge tickets.
remove_duplicated
Takes a single SVK::Merge::Info object as an argument. Removes merge tickets which are present in the argument and for which the
argument's revision is less than or equal to our revision.
subset_of
Takes a single SVK::Merge::Info object as an argument. Returns true if our set of merge tickets is a subset of the argument's merge
tickets. Otherwise, returns false.
is_equal
Takes a single SVK::Merge::Info object as an argument. Returns true if our set of merge tickets is equal to argument's. Otherwise,
returns false.
union
Return a new SVK::Merge::Info object representing the union of ourself and the SVK::Merge::Info object given as the argument.
resolve
verbatim
as_string
Serializes this collection of merge tickets in a form suitable for storing as an svk:merge property.
TODO
Document the merge and ticket tracking mechanism.
SEE ALSO
SVK::Editor::Merge, SVK::Command::Merge, Star-merge from GNU Arch
perl v5.10.0 2008-08-04 SVK::Merge::Info(3)