Sponsored Content
Top Forums Shell Programming and Scripting Merge different versions of file in UNIX Post 302757789 by AjMyTechGroup on Friday 18th of January 2013 03:31:11 AM
Old 01-18-2013
Code Merge different versions of file in UNIX

Hello Experts,
I want to merge my local file (File1) with the changes in remote server (File1). For Example:

File1 contents are... (file @ remote server)
ABC
<blankLine>
GHI
<EOF>


I, as USER#1, have updated the contents of File1 in my local as...
ABC
DEFGhi
<blankLine>
JKL
<blankLine><EOF>

meanwhile, some USER#2, have already commited the new changes in remote server repository...now the File1 contents, @ remote server, are...
ABC
123DEF
GHI
<EOF>

Now, I don't want to simply replace remote File1 with my local File1 coz by doing so, I might overwrite on USER#2 changes. So now I need to merge the latest file in remote server repository with my local file changes (without changing the sequence). Can anyone please help?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

What different versions of UNIX are there?

Aside from the normal Linux distros, OS X, and the BSDs, what other forms of UNIX are there? I want to try one on a very old 75mhz box I have. Thanks in advance. (3 Replies)
Discussion started by: AMDPwred
3 Replies

2. UNIX for Dummies Questions & Answers

why are some unix versions licensed ?

Like Unix Sco for example , i know that unix is available for free, maybe some utilities cost money...What is special about Unix Sco??? (2 Replies)
Discussion started by: BAM
2 Replies

3. UNIX for Dummies Questions & Answers

Diffrent versions of Unix/Linux

With so many diffrent flavors out there, how is a person soposed to know what to go with? I'm not asking for specific discussion here in this forum, but I would like to see various pages and articles dicsussing the pluses and minuses of various unix/linux OS's. I have been searching various... (1 Reply)
Discussion started by: MorderKartoffel
1 Replies

4. UNIX Desktop Questions & Answers

Need to know all versions of Unix

:confused: What are some of the most popular versions of Unix and why? (2 Replies)
Discussion started by: jpawlicki2
2 Replies

5. Cybersecurity

Unix tracking software versions

I want to maintain a repository to track versions of common daemons running on several platforms such as apache, ssh, mysql; so that i can asociate vulnerabilities for each version of sw, Does anyone know if there is a project about this requirement? I search for projects in sourceforge, freshmeat... (2 Replies)
Discussion started by: Nektar
2 Replies

6. UNIX for Dummies Questions & Answers

Using multiple java versions in unix

Hello we are using java 1.2 in our shell / env it is also set in the main JAVA_HOME env var , but we have also java 1.4 installed , now we need to use new application that uses only java1.4 is there any way to point this specific application to use java 1.4 without changing the global... (2 Replies)
Discussion started by: umen
2 Replies

7. UNIX for Dummies Questions & Answers

Versions of UNIX

Hi all: I was just wondering if someone could tell me what versions of UNIX are available to public? I'm aware of all the available distro's for Linux e.g. Debain, SuSe, RedHat, etc ... However you never really here much about UNIX distro's! Is UNIX BDS a common one in use? Thanks Oliver (4 Replies)
Discussion started by: oliver79
4 Replies

8. UNIX for Dummies Questions & Answers

Differences between different versions of Unix

I sent a private message to one of the administrators/moderators, but I thought I'd ask here publicly after some thought. I'm getting into Unix on my Mac (BSD). I was just wondering what the differences are between versions of Unix -- I want to learn more about it, but would it be better to... (1 Reply)
Discussion started by: Straitsfan
1 Replies

9. UNIX for Advanced & Expert Users

merge two tab delimited file with exact same number of rows in unix/linux

Hi I have two tab delimited file with different number of columns but same number of rows. I need to combine these two files in such a way that row 1 in file 2 comes adjacent to row 1 in file 1. For example: The content of file1: field1 field2 field3 a1 a2 a3 b1 b2 b3... (2 Replies)
Discussion started by: mary271
2 Replies

10. Fedora

All different versions of UNIX

Hello, I am very new at this and would like to know how many versions of Unix there are and all of the different versions of unix. (3 Replies)
Discussion started by: rosanna azani
3 Replies
JOIN(1) 						      General Commands Manual							   JOIN(1)

NAME
join - relational database operator SYNOPSIS
join [ options ] file1 file2 DESCRIPTION
Join forms, on the standard output, a join of the two relations specified by the lines of file1 and file2. If file1 is `-', the standard input is used. File1 and file2 must be sorted in increasing ASCII collating sequence on the fields on which they are to be joined, normally the first in each line. There is one line in the output for each pair of lines in file1 and file2 that have identical join fields. The output line normally con- sists of the common field, then the rest of the line from file1, then the rest of the line from file2. Fields are normally separated by blank, tab or newline. In this case, multiple separators count as one, and leading separators are dis- carded. These options are recognized: -an In addition to the normal output, produce a line for each unpairable line in file n, where n is 1 or 2. -e s Replace empty output fields by string s. -jn m Join on the mth field of file n. If n is missing, use the mth field in each file. -o list Each output line comprises the fields specified in list, each element of which has the form n.m, where n is a file number and m is a field number. -tc Use character c as a separator (tab character). Every appearance of c in a line is significant. SEE ALSO
sort(1), comm(1), awk(1) BUGS
With default field separation, the collating sequence is that of sort -b; with -t, the sequence is that of a plain sort. The conventions of join, sort, comm, uniq, look and awk(1) are wildly incongruous. 7th Edition April 29, 1985 JOIN(1)
All times are GMT -4. The time now is 04:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy