Latly Ive been coming across the need to use data from one text file to update a second text file. I've been doing all this manually and I know there is an easier way to do it. So I thought I would ask and see if anyone might want to help me with some scripting ideas to make my life a little easier.
First of all I only know a small handful of scripting techniques... and not nearly enough to acomplish what I need to do. However here is a quick example of what I need to script.
I have two files that are similar...
File A has line entries that look like so (it can have between 200-20,000 lines)...
Code:
#file /directory/app/data1/sub/file.name
#file /directory/app/data1/sub/file.name17
#file /directory/app/data1/sub/file.name23
File B has entries like so
Code:
INSTANCE file /directory/app/data1/sub/file.name createdate
INSTANCE file /directory/app/data1/sub/file.name16 createdate
INSTANCE file /directory/app/data1/sub/file.name23 createdate
Now, what I need to do is if the dirctory/file listed in File A, matches the directory/file listed in File B... I need the corrosponding line in File B to be deleted.
Is there anyway to automate this? I can easily use sed and remove the "#file" from the entries in File A if that would make it easier? I know there is a way to do this but I am no good with scripting so I do not know where to begin to get started testing a script to do this?
Any help would be appreciated.
thanks,
Trey