Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2012
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Mass HTML export batch editing

    I've been trying to type up my mom's recipe's for a while now, and I've been using a program she supplied me to format everything correctly.

    One of the perks of this program is that it has an "Export to HTML" option, giving me an easy way to back up her recipes on my domain. However, the HTML that is provided is the bare bones HTML code, and since I have no experience in writing batch files, I need to request your help.

    What I'd like (if possible) is a batch file that can add
    Code:
    <link rel="stylesheet" type="text/css" href="css.css">
    and a line break on line six, a free program capable of mass edits, or an alternative method of amending this link into the 500+ recipes that I now have.

    The exported HTML looks like this:

    Code:
    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta charset="ISO-8859-1" />
            <title>COMPANY CASSEROLE var. 2</title>
        </head>
        <body>
            <div style="margin: 15px;">
    
                <!-- Recipe -->
                <div itemscope itemtype="http://data-vocabulary.org/Recipe" >
                    <h1 itemprop="name">COMPANY CASSEROLE var. 2</h1>
                    <img itemprop="photo" src="" alt="" style="margin: 4px;" />
                    <p style="font-style: italic;"><span itemprop="summary">Courtesy of Dianne Osler</span></p>
                    <div style="font-size: 0.85em;">
                        Prep time: <time datetime="" itemprop="prepTime"></time><br/>
                        Cook time: <time datetime="" itemprop="cookTime"></time><br/>
                        Yield: <span itemprop="yield"></span>
                        <br/>
                        <br/>
                        <span itemprop="nutrition" itemscope itemtype="http://data-vocabulary.org/Nutrition">
                            Serving size: <span itemprop="servingSize">8</span><br/>
                            Calories per serving: <span itemprop="calories">162</span><br/><br/>
                        </span>
                    </div>
    
                    <b>Ingredients:</b>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount">1 package</span> instant 
                        <span itemprop="name">long grain and wild rice mix</span>
                    </span>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount">1 1/2 cups</span> cubed 
                        <span itemprop="name">turkey ham</span>
                    </span>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount">8 ounces</span> sliced 
                        <span itemprop="name">mushrooms</span>
                    </span>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount">16 ounces</span>
                        <span itemprop="name">broccoli</span>
                    </span>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount">1 1/2 cups</span> cubed 
                        <span itemprop="name">Cheddar cheese</span>
                    </span>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount">1 (10 1/2-ounce) can</span>
                        <span itemprop="name">cream of celery soup</span>
                    </span>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount">1 cup</span>
                        <span itemprop="name">plain yogurt</span>
                    </span>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount">1 teaspoon</span>
                        <span itemprop="name">curry powder</span>
                    </span>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount">1/2 cup</span>
                        <span itemprop="name">milk</span>
                    </span>
                    <br/>
                    <span itemprop="ingredient" itemscope itemtype="http://data-vocabulary.org/RecipeIngredient" style="margin-left:7px;">
                        <span itemprop="amount"></span>
                        <span itemprop="name">Parmesan cheese</span>
                    </span>
                    <br/>
                    <br/>
                    <br/>
                    <b>Directions:</b><br/>
                    <div itemprop="instructions">
                        Prepare rice following box instructions and put in long oblong pan.
    <BR>Place ham, mushrooms, broccoli, cheese in order next. Mix together soup, yogurt, curry, & milk.
    <BR>Pour over casserole. Sprinkle Parmesan cheese on top.
    <BR>Bake at 350° for 45 mins.<P align=left><br>Recipe formatted with the Cook'n <a href="http://www.dvo.com/index.html?CID=export_to_html_feature">Cookbook Software</a> from DVO Enterprises.
                    </div>
                </div>
                <!-- /Recipe -->
    
            </div>
    
            <div style="width: 110px; height: 50px; margin: 50px auto;">
                <a href="http://www.dvo.com"><img id="cooknLogo" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" alt="" border="0" height="40" width="88"/></a>
            </div>
    
            <script type="text/javascript">
            // Omitted because it's long and doesn't apply
            </script>
    
        </body>
    </html>

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,666
    Thanks
    6
    Thanked 1,006 Times in 979 Posts
    All you need is a multi-file search and replace functionality. I guess all the more advanced text editors like Notepad++ have this. Oh, and this is what I found with a quick search: http://lifehacker.com/find-and-repla...mult-511746932

    All you need to search for is </title> and then replace it with:
    Code:
    </title>
    <link rel="stylesheet" type="text/css" href="css.css">

  • Users who have thanked VIPStephan for this post:

    bosler (08-02-2013)


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •