I want to be able to merge the .txt-files in each folder, so the location of the input or output-files should not be specified in the code, the .bat-file is to be placed in any folder and output file should also be generated here.
Example:
meat.txt
Code: Select all
Frankfurter tail turkey doner
<p>Bacon ipsum dolor sit amet turkey sausage brisket pork.</p>
<p>Tongue swine turducken capicola shoulder hamburger pig.<p/>
<p>Ball tip jerky ham, doner <a href=""https://en.wikipedia.org/wiki/Meat"">filet mignon ham</a> hock bresaola jowl andouille pig cow</p>
batman1.txt
Code: Select all
Batman
<p>You either die a hero or you live long enough...</p>
<p>...to see yourself become the villain.</p>
I want to merge these into a single .txt file, which has one files content per row.
I have the following code right now:
Code: Select all
for %%f in (*.txt) do type "%%f" >> combined.txt
Which merges all the content into one file.
But in combined.txt every file gets many rows, instead of one.
I was wondering if it's possible:
- - Wrap quotationmarks around the first line
- Add a comma after the first line
- Wrap quotationmarks around the first <p> tag and the last </p> tag
- Remove the blank spaces/linebreaks between </p> and <p>
I output .txt file I want should look exactly like this:
Code: Select all
"Frankfurter tail turkey doner","<p>Bacon ipsum dolor sit amet turkey sausage brisket pork.</p><p>Tongue swine turducken capicola shoulder hamburger pig.<p/><p>Ball tip jerky ham, doner <a href=""https://en.wikipedia.org/wiki/Meat"">filet mignon ham</a> hock bresaola jowl andouille pig cow</p>"
"Batman","<p>You either die a hero or you live long enough to see yourself become the villain.</p>"
Is this possible?
Would love to get some help!
Cheers!
/ Lui Kang