Processing multiple files in a directory and merging them with sample text

Hi,
I'm trying to use automator (or applescript, or cmd line) to perform a repetitive action on around 5,000 html files.
Here's the problem, can anyone help with the solution.
Sample text is in a file called sample.txt
I want to add the sample txt content to every file in a directory of my choice.
so the script would need to.
1. work it's way through the directory content.
2. For each file it would append the content of the sample.txt and re-save the file to the original file name.

sorry but in your first message you said you wanted it at the end of the file. also, you didn't really answer my question. an html file in text form usually starts with <html><head>... (it can have other junk there too)
and ends with ...</body></html>.
how do you want to handle that?
cycling through files is not a problem.
if you are using shell script action you can do the following:
1. get specified finder items (put the folder with your html files in there)
2. get folder content
3. run shell script (pass input as arguments)
for f in "$@"
do
#your shell script here
done
In the above "$@" is treated as the ambient folder from step 1 and f as the unix path of an item in that folder.

Similar Messages

  • Process all files in a directory and its subdirectories

    Hello all,
    I want to write a program that processes separately all the files in a given directory. I would like to open folders in that directory (if any) and further process all the files contained in them as well. Any suggestions with some Java code to do this as time effectively as possible? Thanks in advance.

    Hello Chuck,
    thanks for answering. You probably meant: "Search the forum archive - maybe your question has already been discussed. This way you help people focus on topics that have not yet been resolved."
    Generally http://forum.java.sun.com/thread.jspa?forumID=31&threadID=510545 suits well. My problem is however, that I would like to pass the absolute path (not the relative one) of the directory which content (including subdirectories if any) should be further processed. Any suggestions how to make it function with the absolute path passed as input argument to the program?

  • How do you take MANY slices of an audio file on garage band and merge them together without dragging and dropping each one?

    I record my classroom lectures in law school to help study for finals. However in the hour and a half class there are many pauses, bad questions, wrong answers, useless stories or announcements that I do not have to hear again. I import the audio into gargae band and cut out all the unnessesary stuff. I end up with a file of 100 + clips. If i spend the time dragging and droping them so there are no spaces in between clips the process takes forever. However the reward is relistenign to an hour and half lecture in 15-20 minutes. Thats about how much content the professor gives. Is there a way to merge all the audio by selecting some option? I bascially want garage band to just slide all the clips and condence it to one clip.
    I have takent the time the last few semesters to do this the hard way and have been able to relisten to an entire class in 3.5 hours which is huge! if you have ever been in law school. But I don't have that kind of time anymore. HELP!

    petruch wrote:
    Is there a way to merge all the audio by selecting some option?
    http://www.bulletsandbones.com/GB/GBFAQ.html#cutsectionnospace
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • How do I process multiple files and turn them from raw to jpeg

    How do I process multiple files and turn them from raw to jpeg. Ive tried and it seems to go through the files but doesnt seem to process them or store them in the selected folder

    Yes that was the first thing I did. Then I used the process multiple files and selected a new folder to put them in and selected use open files and selected to turn them into jpeg. The images flash on the screen like they are being processed, but the folder never appears in library. Is it possible because there are a couple 16 bit files open that this corrupts the task. Do I need to create the folder first. Will elements not create the folder on its own.
    Thanks Vince

  • Sub folders and Process multiple files in Photoshop Elements 10

    I am looking to apply the same adjustments to numerous images in numerous sub-folders and overwrite the original images.
    Using the Process Multiple Files options,  I added the main folder (which contains no images) to the Source field, selected the Include All Subfolders tick-box, also selected the Same as Source tick-box (which warns you original files will be overwritten) and then completed the image adjustments I required.   However, after running the process all the adjusted images were saved in the main folder and did not overwrite the originals contained in each sub-folder.  Does anyone know if there is a setting I am missing to replace the images in the sub-folders or is this by design ?

    bossti a écrit:
    hi, so is it possible to keep the same subfolder structure as output location? regards! bostjan
    No...
    I think you are going to run great risks in trying to use batch process like 'process multiple files' or 'export' while relying on subfolder structures.
    - the organizer is much more powerful with its database and keywords management than a folder structure organization,
    - Batch processes are limited in Elements
    - 'Good practice' calls for keeping originals intact.
    What are you wanting to do exactly ? We might be able to suggest alternative workflows.

  • HOW TO - Create new from clipboard and process multiple files - please help

    Need help - have new version of photoshop on trial only ATM...
    Want to know - HOW TO:
    1. Create new from clipbaord
    2. Process multiple files
    Please help.

    For clipboard copy, I start with File > New and the size will be set to what's in the clipboard. Then once the new file is opened, Edit > Paste will place the clipboard contents as a layer in the new document.
    You must remember to use the command Layer > Flatten Image of you want to save as jpeg or any other file format that doesn't support layers.
    For processing multiple files,
    File > Automate > Batch or
    File > Scripts > Image Processor...
    Check the User guide or google information for those commands if you have specific needs.
    Gene

  • Process multiple files and stack with originals

    I have had an ongoing frustration with PSE.  After ranking my photos I use the raw import to post process multiple photos.  Almost all of my post processing occurs during the raw import of my NEF originals.  When done I save the files as stacked JPGs.  Unfortunately I have not found a way to process multiple files and have them stay stacked with the originals.  This results in me doing a "Save As" for every single photo in the photo bin.  VERY TIME CONSUMING!!
    Has anyone determined a way to process multiple files into JPGs and have them stacked with originals?  I am sure this is possible and it is really driving me crazy!!  Any help would be greatly appreciated. 
    Ken
    P.S.  I did search the forums for key words around this issue and wasn't able to turn up any hits.  My apologies up front if this has been addressed before.

    Check http://photoshopelementsbyadobe.blogspot.com/2010/02/batch-processing-in-adobe-photoshop.h tml if it helps...
    But you will have to stack them manually and Auto-suggest stack can also be helpful !
    Give it a try and feel free to ask specific questions...

  • How can I use the "Correct camera distortion" filter and process multiple files in PSE 11?

    How can I use the "Correct camera distortion" filter and process multiple files in PSE 11?

    Did you check the help page for Correct Camera Distortion and Process multiple file
    Correct Camera Distortion: http://helpx.adobe.com/photoshop-elements/using/retouching-correcting.html#main-pars_headi ng_5
    Process multiple files: http://help.adobe.com/en_US/photoshopelements/using/WS287f927bd30d4b1f89cffc612e28adab65-7 fff.html#WS287f927bd30d4b1f89cffc612e28adab65-7ff6

  • Process Multiple Files Adding File Type as Part of Name

    I'm using the "process multiple files" command to converts folders of tiff files to jpeg.
    I routinely hide extension names of my files.
    All my files are being converted with the ".tiff" extension added as part of the name, and I can find no way to prevent the process from adding this suffix.
    So, for example, a tiff file I see as "Name" gets converted to jpeg as "Name.tiff"
    So, if I then display the extension/file type on the new file, what I see is "Name.tiff.jpg"
    Is there any way to prevent the process from adding ".tiff" to the end of each filename? I have a few thousand of these to do, and am not looking forward to manually deleting that suffix off each file.

    Batch Rename:
    You can rename original/input files or you can copy/move original files to output directory and rename the files in the output directory. For renaming, you can generate a name pattern for new names and the starting index for numbers.
    Please be very carefully when you use rename and first test your options with dummy files; batch rename can be very powerful = dangerous! Using bad name pattern, combined with options like Move/Rename original/input files and/or Overwrite existing files, you can, under special circumstances, remove all input/original files! Please do not use these options, until you REALLY know what you are doing.
    Hint:
    If you want e.g. 3 digits in the new rename name, you must also write 3x "#" in the pattern!
    Example:
    Pattern image_### with start index 1 will produce file names "image_001", "image_002", etc.
    Click on Set rename options to open a dialog for further options for the renaming process.
    Check those you want to use, then click OK. To exit without making any selections, click Cancel.
    Batch Conversion + Rename:
    This option combines the normal Batch Conversion with Batch Rename. You can set the name pattern for the output files
    The above is from the help file of Irfanview, a free program, which you can obtain here:
    www.irfanview.com
    This will rename in a pattern, but I don't know if this is suitable for your purpose.

  • Process Multiple Files, PDF failing

    I am trying to use the option to process multiple files in PSE 9. I select the source folder, destination folder, and no matter what I select as a converting option I get the error.
    "There were no source files that could be opened by photoshop elements"
    Despite the fact that PSE successfully opens each of these PDF files in the background, it just doesn't do any processing and displays the error.  So now if I go back under the process multiple files menu, and select Process Open files, and click OK, it will now convert each of the files that PSE left open during the previous failed attempt.
    In this particular test case I am trying to convert 10 1 Page PDF files to PNG format, but again the destination format selected does not matter as it fails no matter what. This seems like an obvious case of some sort of bug based on the fact that PSE is successfully opening and converting each file, it just won't do it when the folder is selected as the source.
    Any advice or suggestions would be appreciated, as we are currently running a trial of 9.0 to verify it can do everything we need it to do around the office. We are currently running PSE 2.0 so needless to say we are looking forward to running software thats just slightly newer if we can get some problems worked out.

    Did you ever figure this out?
    I have 100 single PDF files that I would like to convert to JPG.  There are online tools like zamzar.com to do this but there are limits on number of files, or if combined on the size.
    I have Adobe Photoshop Elements PSE 11 and using the batch processing "Process multiple files" option I can select that "from" directory, it thinks awhile, opens them all in Adobe Photoshop with the same error you indicated above: "There were no source files that could be opened by photoshop elements".  It does not make sense because as you say, I can then simply "Save As" and convert into jpg format.  Opening a PDF file without multi support works just fine, as well.  The tool does what I need, just doens't work in the batch mode.
    Thanks!

  • Process multiple files issues

    Hi all,
    I tried to process multiples files with PSE9.
    My purpose was :
    Source DNG files
    Photo optimization, add a tag left bottom and record the results into jpeg high quality files in an empty directory.
    The results I got were :
    -optimization applied
    -Tag not included
    -for every single file a pop up windows required a location to register the file (psd format)
    -no jpeg file produced
    I do not understand what I miss coded so that I did not get my jpegs.
    How can I avoid the pop up phase?
    Regards,
    Thierry

    Michel,
    I ran the test again with ACR screen tagged at 8 bits rather than 16 bits.
    The process went up to the end without any pop up. The tag is there etc.
    As a conclusion I would say that you're right and when you require a jpeg while you openned the file as 16 bits PSE9 propose a compatible format even if the message is not explicit.
    Regards,
    Thierry

  • Can't process multiple files on one of three catalogs

    After getting straightened out about getting my catalogs in order, which I've done, I've run into another problem. I have three catalogs one for People, one for Things and one I call Workplace where I try out things that are new to me so I don't mess up my main catalogs.
    I've straightened out the files in my Things catalog. I have one catagory that contains images of autograph book pages from the late 1800s. Those scans were done in JPEG some time ago. I've tried using multiple processing to change these 55 images to psd in the original file to be consistent with the rest of the catalog. Each time the process fails.
    In order to see what the problem might be I have copied the catagory file into both of my other catalogs and have been able to process the catagory file back into itself as psd. I have also created another small file in the Things catalog and tried to convert it and had the same result. The warning info box that appears when copying back into the same file states that the original files will be overwritten. The psd files do not overwrite the jpg files. They are added to the original file. That may be the way it is intended to be. That's not a real problem.
    The real question is why can't I process multiple files in the original catalog. I have looked at the error file and, although I don't know much about most of it, I found the following in the first part of the file.
    crash exception="EXCEPTION_ACCESS_VIOLATION"
    I run XP SP3 and PSE 8. I am a single user with administrator rights. I find no mention of a  permission filter in the PSE 8 program.
    I'm stuck until I solve this problem and I need help getting it done. Any suggestions or information will be greatly appreciated.
    Message was edited by: Minocq

    One thing to try : instead of using 'process multiple files', can you use the 'export' feature in the Organizer to export the jpegs of that category in psd format into a new folder ?

  • PhotoShop Elements 10...I need help with font size for watermark in Processing Multiple Files.....

    I have PhotoShop Elements 10, and I am trying to watermark some of my photos, I have successfully added them one at a time with a font large enough to be seen. Now I am trying to add it using the "process multiple files" , I can do that but the font even at 72 the largest setting is so small on the photo you can barely read it! Can anyone help me the size larger on my photos?

    Thank you, Michael. I just watched the Russell Brown video again for CS6 and looked real closely at his settings in ACR and he was using 240ppi. I changed my file in image size to 240 ppi and then ran the script and the layer didn't change size this time when I ran the script.
    It is kind of annoying to have to change the image size everytime I want to run this script and then change it back again as most of my files are 300 ppi. I used to run his script for edit in ARC in CS5 and recall that if I just remembered to change the settings in ARC to 300 ppi while the script was playing and before pressing 'open' that the image wouldn't change size during the raw processing, but this doesn't seem to be working in CS6. Do you know of a way to use this script and not have to change the ppi for the image to 240?
    Thanks again.

  • Process Multiple Files in Bridge

    I am trying to process multiple files in Bridge CS3 using Photoshop Elements 9.  It does not give me an error, it just does nothing.  Can someone help me figure out how to fix this?  It used to do this now I am having problems.

    Can someone help me figure out how to fix this?  It used to do this now I am having problems.
    Without knowing your workflow or your OS to my knowledge Bridge CS3 is not designed for Photoshop Elements 9 but for Photoshop CS3. There used to be a Bridge CS4 version bundled with PSElements 8 for a Mac but thats all I know about it.
    However if you want to open files from Bridge in PS Elements you should either select the files you want and with right mouse click menu choose open with and from the submenu choose PSElements 9 or go to the Bridge preferences file type associations and change the file type you need in PSE to open in PSE9 by default.
    If this is not the answer you expected could you be more specific about OS (windows/Mac) and what you mean with process (raw settings, batch actions or just open in, etc.)

  • Jpgs are greyed out in process multiple files.

    I have a new iMac, with Elements 11, all jpgs are greyed out when I try to process multiple files.
    Dawk

    Are these photos in iphoto? You can't access the iphoto library directly. Writing into that library from outside iphoto is the fastest way to corrupt it and lose the photos. Export the photos from iphoto and work on the exports. If that's not it, where are these jpegs located?

Maybe you are looking for

  • Pay on Receipt AutoInvoice Program

    Hi, I am running the Pay on Receipt AutoInvoice Request and the Payables Open Interface Import Request after creating a standard PO and receipt (direct delivery). The Invoices created post this have Approval status mentioned as "Required". Is this ok

  • Statements to validate about BPM and WorkFlow

    Hi is it possible for experts here to validate, 1. SAP Business Workflow is primarily used to develop workflow mechanisms for SAP based systems 2. Components of a Business Process Execution Language (BPEL) like the compensation handlers, exception ha

  • Develop settings did not transfer in Lightroom 5

    Hi, when I upgraded my catalog from Lightroom 4 to Lightroom 5, it appears that not all of the my develop settings transfered for all photos.  If I am to open the catalog in Lightroom 4, the appear to still exist.  How can I see all the settings in L

  • EWA alert report is not generating in SMP through SDCCN !!

    Dear Techies, Kindly help me on this issue, I am generating EWA in SDCCN, it is generating fine through RFC Connections successful. But I am not getting EWA report in SMP. All steps performed successfully but no EWA report in SMP inbox ( service mess

  • My Photoshop Elements 6 doesn't have Rectangle tool...

    Or, at least, I really suck at finding it. I need a Line tool, one that can do sideways lines. (Not Shift in other words) I don't know why I don't have it, but every written Guide I go to on it say I'm weird for not having this tool. (Over Dramatizin