LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   command to merge old with new files (https://www.linuxquestions.org/questions/linux-newbie-8/command-to-merge-old-with-new-files-937199/)

said76 03-29-2012 10:53 PM

command to merge old with new files
 
Hi,

I was wondering if anyone might be able to help me here. There is a program that I need to upgrade to the next version. However, instead of overwriting the old files with the new ones, it requires me to merge them. I have not done this myself before as I am still learning my way around ubuntu server 10.04 OS. I wonder what command I can use to merge two files together.

Any help would be greatly appreciated.

Thank you

divyashree 03-29-2012 11:15 PM

cat command is there for concatenation.

check
Quote:

man cat
merge file1 and file2 and save in file3.

Quote:

cat file1 file2 > file3

David the H. 03-30-2012 06:11 AM

I think it would be better to get some more details before we go offering "solutions" based on guesswork.

Specifically, "merge" is a word that can have many different interpretations. The cat command given above simply appends the second file after the first one. But if you mean something that intersperses lines, removes duplicates, or what, you're going to have to detail that.

So give us an actual example of what you need to do. Post the input texts and the desired output. And don't forget to use [code][/code] tags to protect the formatting.

A few other details, like what this mysterious "program" is, might help too. Instead of posting vague descriptions, try reading How To Ask Questions The Smart Way, and give us some specifics. Thanks! :)


All times are GMT -5. The time now is 06:43 AM.