Hello. I would be very pleased if sb. help me to solve my problem. I've got a file with many non blank lines and I want to merge all lines into one not destroy the informations on them. I've tryed it with split and paste, tr, sed , but everything I've done has been wrong. I know about crazy... (8 Replies)
Hi All,
I want to merge two lines in a file till the end of the file. So what could be the command to get so.
say file name : sample.txt
contents:
country=1
send apps =1 rece=2
country=2
send apps =3 rece=3
..
...
output:
country=1;send apps =1 rece=2
country=2;send apps =3... (6 Replies)
Hi,
I want to merge the lines starting with a comma symbol with the previous line of the file.
Input :
cat file.txt
name1,name2
,name3,name4
emp1,emp2,emp3
,emp4
,emp5
user1,user2
,user3
Output
name1,name2,name3,name4
emp1,emp2,emp3,emp4,emp5 (9 Replies)
I have a large file where some lines have been split into two lines; some of them even with white spaces before the second line. e.g in the following text I want to merge only specific lines ( say UNIX is cool), also removing white spaces only between them, others shall remain same on the output.... (4 Replies)
Hi everyone,
I have two files (A and B) and want to combine them to one by always taking 10 rows from file A and subsequently 6 lines from file B. This process shall be repeated 40 times (file A = 400 lines; file B = 240 lines).
Does anybody have an idea how to do that using perl, awk or sed?... (6 Replies)
Thanks it worked for me. I have one more question on top of that. We had few records which were splitted in 2 lines instead of one. Now i identified those lines. The file is too big to open via vi and edit it. How can i do it without opening the file.
Suppose, I want line number 1001 & 1002 to... (2 Replies)
I have a small problem, which due to my lack of knowledge, has left me unable to decipher some of the solutions that I looked at on these forums.
So below is a piece of text, which I ran via cat -vet, which comes from within a program file. I have many such programs to process and repeatable,... (4 Replies)
I do have a text file with multiple lines on it. I want to put the lines of text into a single line where ever there is ";"
for example
ert, ryt, yvig,
fgr;
rtyu, hjk, uio,
hyu,
hjo;
ghj, tyu, gho,
hjp, jklo,
kol;
The resultant file I would like to have is
ert, ryt, yvig, fgr;... (2 Replies)
Hello all,
I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person.
In the csv, a person may be listed from one to four times... (9 Replies)
Hi,
I am attempting to merge the following lines which run over two lines using awk.
INITIAL OUTPUT
2019 Sep 28 10:47:24.695 hkaet9612 last message repeated 1 time
2019 Sep 28 10:47:24.695 hkaet9612 %ETHPORT-5-IF_DOWN_INTERFACE_REMOVED: Interfa
ce Ethernet1/45 is down (Interface removed)... (10 Replies)
Discussion started by: sand1234
10 Replies
LEARN ABOUT SUSE
git-merge-base
GIT-MERGE-BASE(1) Git Manual GIT-MERGE-BASE(1)NAME
git-merge-base - Find as good common ancestors as possible for a merge
SYNOPSIS
git merge-base [-a|--all] <commit> <commit>...
DESCRIPTION
git merge-base finds best common ancestor(s) between two commits to use in a three-way merge. One common ancestor is better than another
common ancestor if the latter is an ancestor of the former. A common ancestor that does not have any better common ancestor is a best
common ancestor, i.e. a merge base. Note that there can be more than one merge base for a pair of commits.
Among the two commits to compute the merge base from, one is specified by the first commit argument on the command line; the other commit
is a (possibly hypothetical) commit that is a merge across all the remaining commits on the command line. As the most common special case,
specifying only two commits on the command line means computing the merge base between the given two commits.
As a consequence, the merge base is not necessarily contained in each of the commit arguments if more than two commits are specified. This
is different from git-show-branch(1) when used with the --merge-base option.
OPTIONS -a, --all
Output all merge bases for the commits, instead of just one.
DISCUSSION
Given two commits A and B, git merge-base A B will output a commit which is reachable from both A and B through the parent relationship.
For example, with this topology:
o---o---o---B
/
---o---1---o---o---o---A
the merge base between A and B is 1.
Given three commits A, B and C, git merge-base A B C will compute the merge base between A and a hypothetical commit M, which is a merge
between B and C. For example, with this topology:
o---o---o---o---C
/
/ o---o---o---B
/ /
---2---1---o---o---o---A
the result of git merge-base A B C is 1. This is because the equivalent topology with a merge commit M between B and C is:
o---o---o---o---o
/
/ o---o---o---o---M
/ /
---2---1---o---o---o---A
and the result of git merge-base A M is 1. Commit 2 is also a common ancestor between A and M, but 1 is a better common ancestor, because 2
is an ancestor of 1. Hence, 2 is not a merge base.
When the history involves criss-cross merges, there can be more than one best common ancestor for two commits. For example, with this
topology:
---1---o---A
/
X
/
---2---o---o---B
both 1 and 2 are merge-bases of A and B. Neither one is better than the other (both are best merge bases). When the --all option is not
given, it is unspecified which best one is output.
AUTHOR
Written by Linus Torvalds <torvalds@osdl.org[1]>
DOCUMENTATION
Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org[2]>.
GIT
Part of the git(1) suite
NOTES
1. torvalds@osdl.org
mailto:torvalds@osdl.org
2. git@vger.kernel.org
mailto:git@vger.kernel.org
Git 1.7.1 07/05/2010 GIT-MERGE-BASE(1)