topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday April 18, 2024, 6:23 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DONE: Files from Text List with Default Content  (Read 8648 times)

pulphero

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 24
    • View Profile
    • Donate to Member
DONE: Files from Text List with Default Content
« on: March 12, 2013, 02:21 PM »
I'd like to create a few dozen HTM files from a list that I would type in a text file.

Each item in the list would be the name of a separate HTM file.

Also, I'd like to specify a block of content (the same content) that would be added to each file upon creation.

Can't find anything like it, anywhere. Hope it's do-able.

-- Bob

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #1 on: March 12, 2013, 03:34 PM »
How large is the block of content?

c.gingerich

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 748
    • View Profile
    • The Blind House
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #2 on: March 12, 2013, 03:37 PM »
I think I can make something for you. Give me a few.  :)

pulphero

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 24
    • View Profile
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #3 on: March 12, 2013, 03:49 PM »
@skwire: Not large. About 50 words. Possibly a bit more, but not much. Thanks! -- Bob

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #4 on: March 12, 2013, 04:01 PM »
So, basically, you want a bunch of exact duplicate files with differing filenames, whose filenames are sourced from a list that you provide?  If so, this is a piece of cake with a small AutoHotkey script.  Are you familiar with AutoHotkey at all?

pulphero

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 24
    • View Profile
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #5 on: March 12, 2013, 04:07 PM »
Yep, that's what I'm looking for. I have some - but not much - familiarity with AHK. An executable would be ideal, but I'd be happy with just the script.

PS. The purpose of this script is to quickly generate the multiple HTML files that comprise an EPUB.

c.gingerich

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 748
    • View Profile
    • The Blind House
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #6 on: March 12, 2013, 04:14 PM »
Here is something I whipped up quick. I'll work more on it tomorrow. Let me know if this works for you or you need any adjustments.

https://googledrive.com/host/0B8PfRDn6GacXc0RrWUl1clRCRmc/Multi%20File%20Maker.rar

Going to go spend time with my kids! :-)

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,286
    • View Profile
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #7 on: March 12, 2013, 04:17 PM »
Give Chris' application a run-through and see if it satisfies your initial request.   :)

pulphero

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 24
    • View Profile
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #8 on: March 12, 2013, 07:28 PM »
Chris - it seems likes a simple, elegant solution, except that I can't get it to work. I entered my file names in in.txt, per instructions, and then from a command prompt did ... mfm.exe in.txt license.txt xhtml c:\staging ... and got back "mfm is not recognized as an internal or external command, operable program or batch file." Probably my error, as my cmd skills are a bit rusty! -- Bob

c.gingerich

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 748
    • View Profile
    • The Blind House
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #9 on: March 12, 2013, 07:39 PM »
Did you have the command prompt open in the same directory/folder as mfm.exe? So if you extracted the RAR file to c:\temp you need to open the command prompt and make sure you run mfm.exe from that location.

pulphero

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 24
    • View Profile
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #10 on: March 12, 2013, 07:52 PM »
Wow, I AM rusty. That was the problem. Now that I've run it correctly, the results are just what I want. And I really like the ability to specify a text file as the content block for each generated file. This will save me a lot of time. Thanks so much for a valuable addition to my workflow! -- Bob

c.gingerich

  • Supporting Member
  • Joined in 2011
  • **
  • Posts: 748
    • View Profile
    • The Blind House
    • Donate to Member
Re: DONE: Files from Text List with Default Content
« Reply #11 on: March 12, 2013, 07:54 PM »
Great! I'm glad it works the way you like. If there is anything else you want added to it let me know. And thank you!