Batch code for running a find/replace all on multiple files within a source floder/directory

What I need is a Batch source code that will open all files in a folder/directory and run a find and replace_all query within them and then save all the files.  The files were created in Illustrator and saved using the Scene7 FXG format extension.    These files will be uploaded into Scene7 as a group after the find and replace macro/query is run on the code.  The same find and replace query will be the same for all the files.  Basically this function or batch process  will save time in setting the same parameters all at one time instead of having to set the parameters individually in scene7.
a source code sample of the find/replace module macro might be              searchString:  s7:colorvalue="#FFFFFFFF" 
                                                                                                                      replaceString: s7:colorValue="#&txtclr;"
                                                                                                                      searchWhat   "FXG document"    
                                                                                                                         searchSource:  true,
                                                                                                                    useRegularExpressions:   true
I have no problems creating batch files within Ai and PhotoShop but I have limited programming skills in how to create source code for manuipulating documents outside of those apps or in a OS invironment.
I could probably come up witha simple program to do what i want for one document but i get lost when dealing with multiple documents in a source folder (prolbem is,  I will be dealing with thousands of documents not 100 or less)
If anything which Adope cloud app would work best:  Dreamweaver or Edge code   (or just use my notepad)

What I need is a Batch source code that will open all files in a folder/directory and run a find and replace_all query within them and then save all the files.  The files were created in Illustrator and saved using the Scene7 FXG format extension.    These files will be uploaded into Scene7 as a group after the find and replace macro/query is run on the code.  The same find and replace query will be the same for all the files.  Basically this function or batch process  will save time in setting the same parameters all at one time instead of having to set the parameters individually in scene7.
a source code sample of the find/replace module macro might be              searchString:  s7:colorvalue="#FFFFFFFF" 
                                                                                                                      replaceString: s7:colorValue="#&txtclr;"
                                                                                                                      searchWhat   "FXG document"    
                                                                                                                         searchSource:  true,
                                                                                                                    useRegularExpressions:   true
I have no problems creating batch files within Ai and PhotoShop but I have limited programming skills in how to create source code for manuipulating documents outside of those apps or in a OS invironment.
I could probably come up witha simple program to do what i want for one document but i get lost when dealing with multiple documents in a source folder (prolbem is,  I will be dealing with thousands of documents not 100 or less)
If anything which Adope cloud app would work best:  Dreamweaver or Edge code   (or just use my notepad)

Similar Messages

  • How do I see the source code for 'NI Example Finder'?

    At the LabView Express demo, the rep showed us how to view the source code for 'NI Example Finder' (started with Help, Find Examples...). Please refresh my memory.
    --todd

    There are a couple of VI's that shipped with LabView 7.0, but you can't see the diagrams.
    C:\Program Files\National Instruments\LabVIEW 7.0\resource\system\HelpServer.llb\Run Example Finder__NATIONAL INSTRUMENTS.vi
    Press Ctrl-E on this VI and it prompts you for a password.
    This VI is run by C:\Program Files\National Instruments\LabVIEW 7.0\resource\system\HelpServer.llb\HelpServer__NAT​IONAL INSTRUMENTS.vi
    There's also C:\Program Files\National Instruments\LabVIEW 7.0\help\_exfinder.llb\Example Finder Launcher.vi.
    Tyring to open this VI starts the NI Example Finder. Note the taskbar icon which is different from the normal VI icon.
    It seems like NI is trying to keep us out, even if it used LabView to develop the Example Finder.

  • JSP codes for running a JAVA program

    hello...
    does anyone know the JSP codes for running a Java program from my web page?? i mean i already have my java program compiled... and i just want this java program to run in the background when I click on a button or a link...
    Any idea about this?
    plz advice..
    avi

    yes... u r somewhat right... but this runs on Jakarta Tomcat...
    i'm using the Apache Http Server together with the ServletExec AS which enable the Apache server to run JSP..
    I've created a package where i've put my classes...
    WEB-INF/classes/tbd(package name)/my classes
    and i've added.. package name.. in my java program..
    and then in jsp... i've written..
    <%@ page import="tdb.*"%>
    <jsp:useBean id="exec" class="tdb.textdb" />
    <%exec.convert_data();%>
    but when i run the page it says the package does not exist...
    can anyone tell where to place the folder WEB-INF so that it can run fine?
    thx
    avi

  • Any sample code for an Extractor to read in a flat file?

    Hi SAP gurus,
    Are there any sample code for an extractor to read in a flat file?
    Are there any documentation on custom coding an extractor to dump
    information into an info source?
    Are there any documentation on the pit falls and contraints using Solution
    Manager, the BI tools, particularly on the Info Source?
    Thanks,
    Steve

    Thanks Muppet Mark
    I forgot to mention that I had also tried just fileObject.read() as well and it didn't work either.  It was the same run on sentence result I got with the script I showed above.  Seems odd.  However, the \r instead of \n did the trick.  I had some recollection of another line feed character but couldn't remember what it was, so thanks for that.
    Doug

  • Cannot write the suitable source codes for running program

    I want to write a program that help student to compile program and run program by using some test cases. For the compiled part, i have been wrote it successfully, but for the run part, i cannot pass the test cases to the program for running. Could any ppl help me to find the problem on the followng codes, why the error will on there? how do i change it? Thanks!
    //<!--start get Program Test Case File-->
    java.io.BufferedReader TestCaseBuf = null;
    Connection con = null;
    Statement stmt = null;
    ResultSet rs = null;
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    con = DriverManager.getConnection("jdbc:odbc:compas", "sa", "password");
    stmt = con.createStatement();
    String strSQL = "SELECT testValue FROM TEST_CASE WHERE progID='"+progID+"'";
    stmt = con.createStatement();
    rs = stmt.executeQuery(strSQL);
    try
    while (rs.next())
    TestCaseBuf = new java.io.BufferedReader(new java.io.InputStreamReader(rs.getBinaryStream("testValue")));                         
    finally
    if (rs != null)
         rs.close();
    if (stmt != null)
         stmt.close();
    //<!--end get Program Test Case File-->
    //<!--start run program -->
    String[ ] args2 = new String[ ]
         "java", "-cp", System.getProperty("user.dir"), FileName
    try
         Runtime rt = Runtime.getRuntime();
         Process proc = rt.exec(args2);
         java.io.BufferedReader ireader = new java.io.BufferedReader(new java.io.InputStreamReader(proc.getInputStream()));
         java.io.PrintWriter pwriter = new java.io.PrintWriter(proc.getOutputStream());
    String atestcase = null;
         String line= null;
         try
    while ((atestcase = TestCaseBuf.readLine()) != null) <------------I found that error seems on here!!!!
         pwriter.write(atestcase+"\r");
    pwriter.flush();     
    if (atestcase != null)
              if ((line = ireader.readLine()) != null)
              FileOutput = FileOutput + line +"\r\n";
    else {break; }
         } //while
         catch (java.io.IOException e)
         out.println("[IOException]. Printing Stack Trace");
         e.printStackTrace();
         pwriter.close();
         ireader.close();
    catch (java.io.IOException e)
    out.println("[IOException]. Printing Stack Trace");
    e.printStackTrace();
    //<!--end run program -->

    Whats the error message??
    Just a guess, but could be (without seeing the error) that you've already closed the TestCaseBuf reader by closing the result set, hence when you go to read it, you're reading on closed reader.
    Give this a go...Put the //<!--run program --> code into the result set while loop
    while (rs.next())
    TestCaseBuf = new java.io.BufferedReader(new java.io.InputStreamReader(rs.getBinaryStream("testValue")));
    //<!--start run program -->
    ...some code
    //<!--end run program -->
    } Hard to tell without the error message

  • Has anyone experienced an unintended "find/replace all" in a document (using FM11) ?

    Hi All,
    Using FM11 with Windows7.
    We have a problem with the following:
    If I have completed a Find/Change All in Document A (then close the Find window), then I open Document B and press Control-F to perform a new search, once I start typing the previous word search/change all is applied to Document B when it's not the intention.
    The problem is when Control-F is pressed the last function is highlighted (in this case "Change All") - rather than the word field, so nothing is actually being typed in this field - rather it performs the last function.  The basic work-around is just to make sure we click or tab to the desired field before typing...  OR make sure to delete the previous find/change text fields before closing the window.  When doing things quickly though we may forget - so it gets annoying when we have to fix this or revert to last saved document.
    Users with XP don't experience this. Each time control-F is pressed, the Find term field is the highlight so the new term is typed in as expected.
    Any tips would be welcome. 
    Thank you,
    Tina

    Tina,
    There's been a change in behaviour with FM11's Find/Change (as you've noticed). The dialog now retains focus after a search has been performed and is modal. However, the focus of the field for ctrl-F should place it in the Text area, regardless of platform, not execute the last operation. This is buggy behaviour and I just confirmed this on my platform (regardless of whether your in Doc A or B).
    Please file a bug report at the FrameMaker Bugs & Wish List  (https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&product=63)

  • Find & Replace text in html files

    This is my first real attempt at using Automator, and it has become increasingly frustrating for me. I love the idea of Automator, nice interface, and it appears to be so easy to use. But, I can't get it to actually DO anything and I don't understand why.
    Here is my goal:
    to batch process multiple html files to remove certain characters and words (or replace them with empty space).
    I currently open these files in Pages and do 6 separate Find & Replace commands for each file before I continue with my other processing tasks. This is very tedious and I believe the computer should be able to find & replace multiple items at one time. (I have used other utilities to do batch renaming and trimming file names before.)
    All I want to do is select a group of files (usually 25 at a time) and have Automator get rid of all the unwanted words and characters before I open each file for final processing in Pages. I found a set of Automator actions for TextEdit which includes a Find & Replace action, but I've wasted over an hour so far trying to get it to work.
    When I run the workflow, it acts like it's doing something, but the files remain unchanged. I have tried using actions such as Read Text File, Get Contents of TextEdit Document, Set Contents of TextEdit Document, along with 6 instances of Find & Replace, but I cannot get it to work.
    I'm at a point today where I cannot afford to mess around with this anymore. I have to do it the long way in Pages or else I'll never get it done, but I want to get these Automator workflows to work before I have to repeat this task. (I do this at least once a week right now.)
    Any ideas or suggestions? I've tried reading in the help menus and support pages, but perhaps I'm just not understanding something here.

    Any ideas or suggestions?
    You might be interested in using TextWrangler. It can perform batch find-and-replace changes across multiple selected files.
    Good luck!
    Andrew99

  • If I secure my browser using CISecurity's baseline for Firefox, can I copy all the ".js" files from the hardened system to another?

    I own multiple systems. I have hardened one browser following the guideline provided by CISecurity. Instead of repeating all the configurations performed on that one system, can I just copy all the ".js" files from the secured system to my other systems?
    The ".js" files can be modified using a text editor. Is there a way to lock down these files to prevent modification?

    Dear Joel
    i know two ways to prevent browser from caching your files
    First : The Hard way
    just add ? +Math.random()  in the end of your file
    Like this :
    in HTML :
    <script type="text/javascript">
    (function(){
         var e = document.getElementsByTagName("script")[0];
         var d = document.createElement("script");
         d.src = "index_edgePreload.js?"+Math.random()+"";
         d.type = "application/javascript";
         d.async = true;
         d.defer = true;
         e.parentNode.insertBefore(d,e);
    </script>
    instead of this Line in HTML that created by EA :
    <script type="application/javascript" src="index_edgePreload.js></script>
    Disadvantage : you should do this for all of files you want to prevent from caching
    ===================================================
    Second : The easyest way
    You Should have Access to .htaccess file in your Server
    Open your .htaccess file and paste these codes in it :
    ExpiresActive On
    ExpiresByType application/json "access plus 1 seconds"
    ExpiresByType text/json "access plus 1 seconds"
    ExpiresByType text/plain "access plus 1 seconds"
    ExpiresDefault "access plus 1 month"
    you can type what ever type of file you want to prevent from caching in browser
    Advantage : after do this in your .htaccess file all files with the type you want will not Cache in your browser
    Easy is'nt it ?
    Zaxist

  • HELP FOR RUN PHOTOSHOP IN COMMAND PROMPT AND OPEN FILE

    HELLO
    i have problem for run photoshop in cmd(command prompt) and
    open a file immediate
    for example:
    D:\Program Files\Adobe\Photoshop CS>Photoshop.exe -open -f:\1.jpg
    but these not answer
    I need parameter open in photoshop
    please help me
    thanks

    I would right click on 1.jpg. Select Open with... Select Choose default program... Pick Photoshop and make sure you check "always use the selected program to open this kind of file."
    D:\1.jpg
    Would then open photoshop.

  • Powershell replace text in multiple files lookup CSV

    Hiya guys
    After some guidance please.
    I have a CSV with following details
    MailboxName, PRFNAME,TempConstant
    usera, a, usera.prf,TEMPLATEPRFUSER
    userb, b, userb.prf,TEMPLATEPRFUSER
    userc, c, userc.prf,TEMPLATEPRFUSER
    Im after creating multiple copies of a prf file with the PRFNAME
    Import-Csv $UsernamesCSV | % { Copy-Item "C:\TemplatePRF\Template.prf" "C:\TEST\$($_.NewPRFName)"}
    This creates multiple prfs named correctly based on the prfnames provided in the CSV
    Now I want to search for mailboxname=TEMPLATEPRFUSER and replace to "MailboxName" from my csv.
    so it will be
    usera.PRF
    ContentsMailboxname=user, a
    userb.prf
    contents
    mailboxname=user, b
    So the common field to replace will be TEMPALTEPRF but replace with the relevatnt mailboxname depending on prf name.
    After looking around I found the following
    Param (
    #$List = "C:\TemplatePRF\mailbox.csv",
    $Files = "c:\Test\*.prf"
    $ReplacementList = Import-Csv $UsernamesCSV;
    Get-ChildItem $Files |
    ForEach-Object {
    $Content = Get-Content -Path $_.FullName;
    foreach ($ReplacementItem in $ReplacementList)
    $Content = $Content.Replace($ReplacementItem.TEMPConstant, $ReplacementItem.mailboxn)
    Set-Content -Path $_.FullName -Value $Content
    At the moment all the files will then have the content "mailboxname=" set as user,a and it does not seem to loop through the remaining and replace correctly.

    It looks like something along these lines should work, though the CSV data you posted is currently invalid. If you want to have a comma in a field (such as user, a), it needs to be quoted. Otherwise the comma is treated as a delimiter in the CSV.  Generally,
    I would recommend just quoting everything, to avoid problems. That's what PowerShell does when you use Export-Csv. Here's the test file I used:
    "MailboxName","PRFNAME"
    "usera, a","usera.prf"
    "userb, b","userb.prf"
    "userc, c","userc.prf"
    I got rid of the TempConstant field; there's no reason to repeat that data on every line of the CSV file.  It's just hard-coded in the script right now.  Here's the code:
    $templateFile = 'C:\TemplatePRF\template.prf'
    $csvFile = 'C:\TemplatePRF\mailbox.csv'
    $outputDirectory = 'C:\TemplatePRF\New'
    if (-not (Test-Path -Path $outputDirectory -PathType Container))
    New-Item -Path $outputDirectory -ItemType Directory -ErrorAction Stop
    $templateContents = Get-Content -Path $templateFile -ErrorAction Stop
    Import-Csv -Path $csvFile |
    ForEach-Object {
    $record = $_
    $newContents = $templateContents -replace '(?<=mailboxname\s*=\s*)%TEMPLATEPRFUSER%', $record.MailboxName
    $newFile = Join-Path -Path $outputDirectory -ChildPath $record.PRFNAME
    Set-Content -Path $newFile -Value $newContents

  • Hi I am looking for a way to have trace32 open multiple files on remote computers

    Simply put I am looking for someone who could afford to give me a basic script (vbs) that I could run from an elevated command prompt. It would need to be available for me to type in the name of a remote computer or (mulitple if possible) and also
    allow me to choose log files to open or multiple files and then open them using trace 32. Hopefully it would detect the available log files and show me what is available to choose to open... anyone know of such a thing or know how to go about setting up something
    like this for people to use?
    EDIT
    I was able to create a basic script to do what I wanted but I want to be able to add wildcards for the rollover logs... Can someone suggest the easiest way to do that as I am not sure how to add the wildcards directly before the .log
    here is the script.
    ' ******Created by Luis Delgado*********
    'This script will get a remote computers .log files depending on which documents you enter in the "files to open on remote computer using trace32" section
    'Get and open log files on remote Computer
    on error resume next
    Set WshShell = Wscript.CreateObject("Wscript.Shell")
    strcomputer   = inputbox("Enter remote computer name or leave as localhost for this computer","Get log files from a remote computer with Trace32","Localhost")
    If strComputer = "" Then
      WScript.Quit
    End If
    'Opens trace32
    wshShell.run "C:\Program Files\ConfigMgr 2007 Toolkit\CCM Tools\Trace32.exe"
    'Files to open on remote computer using trace32
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\datatransferservice.log"
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\ccmexec.log"
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\locationservices.log"
    !!!!NOTE!!!
    What I need is for any file that starts with datatransferservices, ccmexec, or locationservices to open in trace32
    my thought would be place a wild card in its respective spots but it does not work see below
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\datatransferservice*.log"
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\ccmexec*.log"
    wshShell.Run "\\" & strcomputer & "\c$\Windows\System32\CCM\Logs\locationservices*.log"

    The roll over logs all have the same name exact the extension is .lo_ , So.. I'm not sure what you are looking for.
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • Shortcut for selecting multiple files within folders

    I'm archiving a load of work on to CD and deleting the files off of my server but keeping the folders on there for reference.
    Currently, I am having to SHIFT + click / COMMAND + click &drag to select these files and it is taking me forever.
    Is there a keyboard shortcut that allows me to select all files within folders rather than just a select all which will select the folders aswell?

    I would switch to list view, then click on the "Kind" column which will group the folders together.  Now you can click and drag to select a large range of files, excluding the folders, or you can click on the first file, the Shift click on the last file to select a large range of files.  At most you would need to do this twice.  Once for files listed above folders, and once for files listed below folders.
    If you want to use the Terminal, there are powerful Unix commands that can do this, however, that same power when misused can wipe out your disk :-)

  • What is the transaction code for running Building block & ECatts?

    Hai guys,
    I am building a new organisation structure using Building block Library. Can somebody tell me which transaction Code to use as well as from where I can download the variant files?
    Thanks in advance,
    Regards,
    maheshwaran. I

    Hello Maheshwaran,
    For the beifit of others looking for this question,
    To create a building block : /smb/bbi   -- > building block builder. --> create new Building blocks.
    This has to be attached to a scenario and inturn to a solution.
    To downlad the variant files : Go to Transaction SECATT  --> Enter the eCatt configutation name --> click on display.
    Now in the Edit Menu, you can see the option to download variant files.
    Regards,
    Karthi

  • Replace all references to files and folders with lowercase in web documents on a site

    Hi I'm working on a test server that runs Ubuntu Unix (but my PC which has Dreamweaver CC is running Windows 8.1). I would like to search and replace in Dreamweaver to change all src and href attribute values inside files (webpages, css, etc.) on my site to lowercase, but with the folder and file names' spelling otherwise unchanged. I already changed the names of the actual files and folders, but wanted to make all references in my files point to them again. I started to use regular expressions in the specific tag search, but I was not sure how to specify letter case conversion on a backtracked value. Some flavors of RegEx allow you to replace a searched value in parentheses with its lowercase counterpart by specifying something like this: \L\1
    Where \L converts the character captured in the reference \1 to lowercase. Thanks.

    Hi Jon,
    Thanks for your response. Yes, I tried. But I’m not sure you can use any RegEx special characters in the replacement text. I put in \L0 and it just replaced the match with the literal string, so href=”Support/Index.HTML” became href=”\L0”
    What I want is href=”support/index.html”
    The reason I didn’t use Dreamweaver to change the actual file and folder names is I have images widely dispersed in subfolders. I didn’t think Dreamweaver would automate that part—I think you can only select a file individually to rename it, and then DW will correct all references to it. But probably can’t rename everything with one command from the root. Well, this is turning out harder than I thought.
    Let me know if you have any other ideas.
    Thanks,
    Dave.

  • Wanted: Lua code for reading / writing TIF, DNG, and/or NEF files.

    Anybody?
    Thx,
    Rob

    Lichtzeichenanlage wrote:
    I bet you have to code it per format.
    Remains to be seen - what I'm doing is pretty narrow in scope.
    Lichtzeichenanlage wrote:
    plugin #1 (XmpEdit) - I just need to update xmp metadata in TIFs & DNGs.
    If I remember correctly, LR writes this data into those data into the files if you press Strg + S or if you configure LR to write allways into the xmp files. If this does not work for you, perhaps http://www.sno.phy.queensu.ca/~phil/exiftool/ or http://www.adobe.com/support/downloads/thankyou.jsp?ftpID=4529&fileID=4219 can provide more options to you.
    Having Lr do it for me wouldn't work, but calling exiftool and harvesting the return stuff from stdout may be better than what I'm doing now - thanks.
    Lichtzeichenanlage wrote:
     plugin #2 (Lr <--> NX2 Interface) - I just need to update the main image in a cooked NEF.
    Call me conservative, but I'm really not a fan of writing in these files. It might work with and SDK, but I think there is no public SDK for it.
    In addition I think it is not possible to translate LRs Development-Settings into NX Settings and NX Settings into LR. By updateing the preview you just have a preview with wrong parameters. Sounds week to me. But I would be glad if you can convince that I am wrong. 
    Most people think I'm crazy. There is no support in the Nikon-SDK for it, but all I need to update is the main rgb image - nothing else.
    Thanks,
    Rob

Maybe you are looking for

  • First Calendar experience

    My first experience with Calendar was that the program wasn't ready yet and that it was unstable.Yesterday, after several learning attempts and two crashes, I finally produced a Caledar 2006 and sent it to Apple for printing. I couldn't use pictures

  • How to cancel a "free" app that isn't free?!

    Hello there everyone! I am hoping you can help me please. I downloaded on my iPhone 5c what was claiming to be a FREE APP FOR THE NEW YORK DAILY NEWS. Once it downloaded it said the FREE was ONLY FOR THE FIRST MONTH! How can I cancel NOW please befor

  • Mapping insight required !

    Hello All, Simple mapping q for u. SOURCE: <?xml version="1.0" encoding="UTF-8"?> <ns0:source1a xmlns:ns0="urn://maptest">    <city>       <street>          <person>1a</person>          <person>1b</person>          <person>1c</person>       </street>

  • Clone a user defined class..

    Hello all, just curious to know how can I copy/clone an instance of a class that I cant change/rebuild? I have gone thru the forums and I understand that to be able to clone a class-instance, the class itself should implement Cloneable or apply the d

  • Unable to print through windows 7 vm

    i have a macbook pro  os lion, installed parallels 7 , then windows 7. then bonjour. printer there. looks if its working. no documents being printed. use laptop wirelesly