Check only the new part of a text file?

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Check only the new part of a text file? Thu Dec 15, 2022 9:14 pm • by halloleo
Hi again. I have another text file that is appended to every night. Is tether an easy way to match against the newly added content?

E.g. The file looks like

Code: Select all
Sync ok.
Compare done.
124534 items transferred.
Connection failed. No Sync.
Compare done.
0 items transferred.
Sync ok.
Compare done.
1245312items transferred.
...

Each time lines get added like:

Code: Select all
Sync ok.
Compare done.
124534 items transferred.

or

Code: Select all
Connection failed. No Sync.
Compare done.
0 items transferred.

When the file changes I would like to check the new portion for "Sync ok".

Can I do this easily with Hazel?
halloleo
 
Posts: 45
Joined: Thu Apr 27, 2017 10:10 pm

Re: Check only the new part of a text file? Fri Dec 16, 2022 10:44 am • by Mr_Noodle
I don't think there's any way to do that with the built-in logic. You'd need a script and even then, you'd need some way of recording where in the file it's at.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Check only the new part of a text file? Fri Dec 16, 2022 4:27 pm • by halloleo
Mr_Noodle wrote:I don't think there's any way to do that with the built-in logic. You'd need a script and even then, you'd need some way of recording where in the file it's at.


Thanks. Makes sense.

I will try to get a single output per run -- this will make it soo much easier!
halloleo
 
Posts: 45
Joined: Thu Apr 27, 2017 10:10 pm


Return to Support