Merge/Remove 2 files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Merge/Remove 2 files
# 1  
Old 04-11-2013
Merge/Remove 2 files

Hi,

I would like to get some advice here. Basically I have 2 diff files, I need to add/comment FileA (old) contents as compared with FileB (new). The file has almost 100k lines so it would be great if someone can advise me on the easiest way out.

For example

FileB has this parameter but missing from FileA - need to add in FileA
Code:
        <Field> 
         <Name>Testing</Name>     
         <Fid>5914</Fid>
         <Type>String</Type>
         <CheckModified>true</CheckModified>
         <PublishField>true</PublishField>
         <ClearDaily>true</ClearDaily>
        </Field>

FileA has this parameter but no longer avail in new FileB - need to comment out from FileA so the original parameter can be retained although its no longer in use.
Code:
        <Field> 
         <Name>Testing</Name>     
         <Fid>5914</Fid>
         <Type>String</Type>
         <CheckModified>true</CheckModified>
         <PublishField>true</PublishField>
         <ClearDaily>true</ClearDaily>
        </Field>

Thanks in advance for any help out there. Appreciate it...

Last edited by vbe; 04-11-2013 at 05:44 AM.. Reason: code tags next time please for your code and data
# 2  
Old 04-11-2013
The two example files you posted appear identical, by testing with diff command. Please try again.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Merge 3 files

help with a command please i have 3 files that i need to merge in to a 4th file using awk or sed the files have more than 3 lines in them file 1 AAA BBB CCCfile 2 AAA BBB CCCfile 3 AAA BBB CCCi want the 4th file to look like this after merging AAA AAA AAA (3 Replies)
Discussion started by: bob123
3 Replies

2. Shell Programming and Scripting

Merge files and remove duplicated rows

In a folder I'll several times daily receive new files that I want to combine into one big file, without any duplicate rows. The file name in the folder will look like e.q: MissingData_2014-08-25_09-30-18.txt MissingData_2014-08-25_09-30-14.txt MissingData_2014-08-26_09-30-12.txt The content... (9 Replies)
Discussion started by: Bergans
9 Replies

3. Shell Programming and Scripting

Help with merge and remove duplicates

Hi all, I need some help to remove duplicates from a file before merging. I have got 2 files: file1 has data in format 4300 23456 4301 2357 the 4 byte values on the right hand side is uniq, and are not repeated anywhere in the file file 2 has data in same format but is not in... (10 Replies)
Discussion started by: roy121
10 Replies

4. Shell Programming and Scripting

Merge files and generate a resume in two files

Dear Gents, Please I need your help... I need small script :) to do the following. I have a thousand of files in a folder produced daily. I need first to merge all files called. txt (0009.txt, 0010.txt, 0011.txt) and and to output a resume of all information on 2 separate files in csv... (14 Replies)
Discussion started by: jiam912
14 Replies

5. Shell Programming and Scripting

Checking in a directory how many files are present and basing on that merge all the files

Hi, My requirement is,there is a directory location like: :camp/current/ In this location there can be different flat files that are generated in a single day with same header and the data will be different, differentiated by timestamp, so i need to verify how many files are generated... (10 Replies)
Discussion started by: srikanth_sagi
10 Replies

6. Shell Programming and Scripting

merge two different files

HI I have input file as date 22jan2011 calc 0 667788.1 998877.2 vals 1 222 444 666 777 999 vals 2 222 444 666 777 999 vals 3 ... (3 Replies)
Discussion started by: Indra2011
3 Replies

7. Shell Programming and Scripting

MERGE FILES

Hi all! How could I merge all the text files (in format xml) of a single folder, after having deleted from each of them all the text from its beginning up to a specific string: "<body>" ? Thanks a lot! mjomba (4 Replies)
Discussion started by: mjomba
4 Replies

8. Shell Programming and Scripting

Merge 2 columns/remove specific spaces

Hi, I have a requirement to remove certain spaces from a table of information, but I'm unsure where to start. A typical table will be like this: ABCDE 1 Elton John 25 12 15 9 3 ABCDE 2 Oasis 29 13 4 6 9 ABCDE 3 The Rolling Stones 55 19 3 8 6The goal is to remove only the spaces between... (11 Replies)
Discussion started by: danhodges99
11 Replies

9. Shell Programming and Scripting

Merge files of differrent size with one field common in both files using awk

hi, i am facing a problem in merging two files using awk, the problem is as stated below, file1: A|B|C|D|E|F|G|H|I|1 M|N|O|P|Q|R|S|T|U|2 AA|BB|CC|DD|EE|FF|GG|HH|II|1 .... .... .... file2 : 1|Mn|op|qr (2 Replies)
Discussion started by: shashi1982
2 Replies

10. Shell Programming and Scripting

merge files

Hi, i have the files f1 and f2 like: files f1: c1 a1 c2 a2 c3 a3 file f2: c1 b1 c2 b2 c3 b3 i want merge the f1 and f2 file to f3 file like: c1 a1 b1 c2 a2 b3 c3 a3 b3........ .... . . please help me onthis..... (5 Replies)
Discussion started by: koti_rama
5 Replies
Login or Register to Ask a Question