I have 2 directories (source, target) which contain multiple files with the same filenames, e.g 001.txt, 002.txt, 003.txt... and so on
for example on the source directory with this 001.txt file
[ZERO_POINT_004]
X=0.000000
Y=52000.000000
Z=50827.000000
ZD=38530.000000
[ZERO_POINT_005]
X=-38000.000000
Y=52000.000000
Z=50827.000000
ZD=38530.000000
[ZERO_POINT_006]
X=-76000.000000
Y=52000.000000
Z=50827.000000
ZD=38530.000000
[ZERO_POINT_LEFT_001]
X=0.000000
Y=0.000000
Z=50827.000000
ZD=38530.000000
[ZERO_POINT_LEFT_002]
X=-38000.000000
Y=0.000000
Z=50827.000000
ZD=38530.000000
[ZERO_POINT_LEFT_003]
X=-76000.000000
Y=0.000000
Z=50827.000000
ZD=38530.000000
and on the target directory with this 001.txt file [ZERO_POINT_004]
X=0.000000
Y=52000.000000
Z=50827.000000
ZD=38530.000000
[ZERO_POINT_005]
X=-38000.000000
Y=52000.000000
Z=50827.000000
ZD=38530.000000
[ZERO_POINT_006]
X=-76000.000000
Y=52000.000000
Z=50827.000000
ZD=38530.000000
Notice that the file in the target directory contain information similar to that from the source directory, but less those highlighted in red. How do I copy the contents difference (in Red color) to the file in the target directory? The contents difference copied over must be on the same lines as what the file in the source directory.
VulpesPosted Dec 29, 2014, 8:09 AM
Try something like this.
I've assumed that each section will consist of the header plus 4 more lines:
TAN WhoAMIPosted Dec 29, 2014, 8:34 AM
TAN WhoAMIPosted Dec 28, 2014, 7:41 PM
Step 1:
Copy all files from source directory#1 to target directory -- completed.
Step 2:
Conversion factor needed for files on target directory: e.g -- completed.
becomes
Step 3 is what I am stuck:
Now, there is another source directory#2 which is similar to source directory#1, but contains something new. Example, it contains
I need those new contents (highlighted in red) from source directory#2 to be copied to the files in the target directory. The files in source directory#2 and target directory are having the same filenames.
VulpesPosted Dec 24, 2014, 6:59 AM