This can probably be done with half a dozen lines of Perl. I haven't coded in 
Perl for years, so I won't try to write the actual code, but it would be 
something like:

        for every line in file 1
        if line contains /<date>.*</date>/
                read a date from file 2
                replace /<date>.*</date>/ in line with the date from file 2
        write line

Trying to be cleverer than that would probably be like trying to trim a hedge 
with a lawn mower.

Regards,

        Neil Faiman

> On Jun 15, 2021, at 7:28 PM, @lbutlr <krem...@kreme.com> wrote:
> 
> I have a file that has a few hundred lines, 77 of which are a HTML/XML style 
> date element
> 
> <date>Tue, 15 Jun 2021 17:12:26 -0600</date>
> 
> I have another files that has 77 date lines in the same format. Everything is 
> different dates, obvs.
> 
> I want to replace the first date in file 1 with the first date in file 2, and 
> so on through the entire file.

-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "supp...@barebones.com" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to bbedit+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/5C5E533F-C426-44EC-88BB-75B5EA5A9BF3%40faiman.org.

Reply via email to