Page 1 of 1

read a .txt file (log.txt) + create a folder

PostPosted: Fri Jan 04, 2019 7:46 pm
by NoodleNewbie
Hello
I want Hazel to read a text file (log.txt), and create a folder for a line in the txt file. The log.txt contains the results of a batch process in this structure
e.g.
ISBN1 _book title - batch result
ISBN2 _book title - batch result
ISBN3 _book title - batch result
ISBN4 _book title - batch result
etc..

I can see in the Match Criteria Hazel has function "contents" and "contents matched". But I dont know how to tell hazel to read first line etc..

1 Read txt file where text is matched to pattern (put this in a new hazel custom variable (9 digits space _))
2 Create a folder, naming to the hazel custom variable
3 loop until text in txt file is "all finished"

Is this possible in shell or something simple -- I dont know how to write apple script.

Thankyou for you guidance.

Re: read a .txt file (log.txt) + create a folder

PostPosted: Mon Jan 07, 2019 11:57 am
by Mr_Noodle
It would have to be done in a script, shell or Apple, to do that. I believe a shellscript shouldn't be too much trouble if you know the basics.