Jython script to remove the quotes

All,

I created the following script as an event script before import to remove the quotes around member names in our source file.  Everything seems to work except the last step of deleting and renaming the file (os.remove and os.rename).  I can see the ".out" file and it seems OK, but the original file is still there.  Any help is greatly appreciated.

If fdmContext ["LOCNAME'] == 'TecLabor_TO_RSA ':

fdmAPI.logInfo (fdmContext ["LOCNAME"])

Try:

filename = fdmContext ["FILENAME"]

Inbox = fdmContext ["INBOXDIR"]

#filedir = fdmContext ['FILEDIR']

fdmAPI.logInfo (filename)

fdmAPI.logInfo (inbox)

file = inbox + '\\TecLabor_TO_RSA\\' + filename

file_out = inbox + "\\TecLabor_TO_RSA\\" + file name ".out".

#file = inbox '-' + filedir + "\\"+filename. "

#file_out = inbox + "\" + filedir + "\\"+filename + «.out "»

fdmAPI.logInfo (file)

end = open (file, "r")

who cares = open (file_out, "w")

for the end line:

Line = Line.Replace ('"'," ")

care. Write (Line)

end. Close()

care. Close()

except IOError, err:

fdmAPI.logError ("My error" + str (err))

OS. Remove (file)

OS. Rename (file_out, leader)

So you're saying that the os.rename and os.remove of commands do not work? If so make sure have included you the following import statement at the top of your script - import bones

Tags: Business Intelligence

Similar Questions

  • How can legends of the slideshow - I remove the quotes?

    I create a slideshow in Lightroom 3 using the legend and the predefined rating.  There are no quotes legends of metadata, but when I saw the slideshow all my legends have quotes. I searched the Edit > Preferences in the slideshow module, but there is no mention of legends or the quotes.  How can I get rid of the quotes?

    Thanks for any help or suggestion!

    (3 days: 55 people have watched this discussion, but no one answered.)  I still hope that I can remove the quotes around my slide show of legends.  Any ideas out there somewhere?)

    WeeZee67 wrote:

    (3 days: 55 people have watched this discussion, but no one answered.)  I still hope that I can remove the quotes around my slide show of legends.  Any ideas out there somewhere?)

    9 views in fact...

    You need to change the preset. Click the text, and then on the toolbar change custom settings, in the legend area.

    You can then save this as a new preset.

  • I need script to remove the line with 2 points, another script to remove next lines

    I need script to remove the line with 2 points, another script to remove next lines of two scripts needed help please

    Thanks in advance

    Concerning

    Lakshmiganth

    Scroll through each pathitem and look at the length of his pathPoints group.  If the length is equal to 2 and then use the remove() method to remove it.  For example (this is rough, off the top of my head):

    var lines = new Array();

    for (i = 0;  I have< app.activedocument.pathitems.length; ="" i++)="">

    If (app.activeDocument.pathItems [i].pathPoints.length == 2) {}

    Lines.push (App.activeDocument.pathItems [i]);

    }

    }

    for (i = 0;  I have< lines.length; ="" i++)="">

    Lines [i]. Remove();

    }

  • Is there an action or a script to remove the variables?

    I have about 500 files created from a source model and a variable (of 500 sets of data). Each of the 500 output files includes the library of variables. I want to separate the object and remove the variable in each of these output files. It will take hours to open each file and manually remove the variable, so I hope that it might be possible to automate this process with a script or a batch action. Unfortunately, however, I don't know enough script to create the script myself. Are there commands that can be combined in an action, or y at - it an existing, to achieve this script?

    Thank you very much.

    Maybe that someone else can promote the use of 'actions' for this?

    About scripting:

    Give a try on a "test copy" of one of your files and see if it's what you want.

    function removeDataSetsAndVariables() {
        if (app.documents.length > 0) {
            var doc = app.activeDocument;
            var dS = doc.dataSets.length;
            var v = doc.variables.length;
            var curV;
            if (v > 0) {
                for (var i = v - 1; i >= 0; i--) {
                    curV = doc.variables[i];
                    curV.remove();
                }
            }
            if (dS > 0) {
                doc.dataSets.removeAll();
            }
        }
    }
    removeDataSetsAndVariables();
    

    In my quick test, the code snippet above will remove all the variables and data sets, is that what you need/want? If Yes, then we can proceed from there. Let us know.

  • Script to remove the first few characters of a PDF file name?

    I know it should be easy, but I'm not a coder and don't have many opportunities to write scripts.  I hope it's like a second request two anyone out there.  All I want to do is point a script in a PDF file that will review the file name, cut the first two characters of the file name and save the original file again.  I need to do this about 400 PDF documents on a recurring basis, hence the need for a script.  Thus, for example, if I have a C:/temp/myFile.pdf file, I would the script to rename the file to just "file.pdf".

    Any help would be greatly appreciated.

    JBF

    Use this code in your action (note that this will not work if your file name)

    contains the comma):

    var filePath = this.path.replace(this.documentFileName,"");

    var NouveauNomFichier = this.documentFileName.substring (2);

    this.saveAs (filePath + newFileName);

  • Remove the &amp; quot; File / exit &amp; quot; drop down menu from the menu bar

    How can I remove the menu option drop down "file / exit" in the menu bar of Authorware?

    I created a menu bar of AW with several drop down menus that works well but Authorware seems to create by default a file / exit option at the beginning which is difficult to remove. Any ideas.

    Thank you very much
    Mike

    AHA... No worries, I found the solution.

    http://www.Macromedia.com/go/tn_16092

  • Help with a Script to remove the additional paths and save

    Here are a few scripts that I have at the moment, but none work. With the first script, I get an error with the 'indexOf', and with the second script, it keeps only the second name listed in the string. How can I get either of these to work where I can remove all the paths, with the exception of multiple ones I want to keep?

    function deletepaths()
    {
      if (!documents.length) return false;
    
    
      var doc = activeDocument;
      var save = ["Ex1", "Ex2", "Ex3"];
    
    
      for (var x = 0; x < doc.pathItems.length; x++)
      {
        if (save.indexOf(doc.pathItems[x].name) == -1))
        {
          doc.pathItems[x].remove();
        }
      }
    }
    deletepaths();
    

    deletepaths();
    function deletepaths(){
    if(!documents.length) return;
    var doc = activeDocument;
    for(var a = doc.pathItems.length-1;a>-1;a--){
    if(doc.pathItems[a].name != ("ex1", "Ex2")) 
         doc.pathItems[a].remove();
      }
    }
    

    IndexOf does not work with extension script. Most likely, you would need a number if statement for many golds ' | ', or a loop in the loop goes well your path names.

  • Help with a script to remove the link "Place and link" content

    Hello

    I need a script that will separate the content that has been placed in an indesign document by using the feature "place and link.

    I know I can manually go to the link Panel, select the linked content here and click 'remove link' in the Panel menu. However, I have about 200 indesign documents that are all full of content that has been 'placed and connected '. One I get a script to unlink content, I can add it to a batch routine to make the record of 200.

    Can anyone help please.

    See you soon

    Like this?

    app.activeDocument.links.everyItem () .unlink ();

  • Import the script to remove the zeros in the field counts

    FDM dear Experts,
    The problem is our source system always extracts 10 characters, but we use 7 characters in HFM.
    Example, in 0001201010 (10 characters) must be 1201010 (7 characters).

    I want to write a Script to import to remove, if necessary, zeros on the left side of the value into account at the stage of import. We have no accounts starting with 0.

    Thanks in advance for your help,
    Carsten

    Service account (strField, strRecord)

    strField = FormatNumber(strField,0,0,0,0)
    Account = strField

    End Function

  • Script to remove the CD always promts of action

    I created this script and am using this still pormts for N Y A anser for the scipt to continue action. What is the command to always answer the question with a Yes?

    Get-cddrive - VM $vm | where {$_.} ISOPATH - don't $null} | set-cddrive - nomedia

    You can use the - confirm: setting $false to avoid making the issue of confirmation:

    Get-cddrive - VM $vm | where {$_.} ISOPATH - don't $null} | set-cddrive - nomedia - confirm: $false

  • Script to remove the color definitions

    I'm trying to create a script that will delete the definitions of color other than the default and corporate colours. I think some type of loop 'while' to go through the list of colors of the RFSO, corresponding to a table of named colors.

    I see that there is an object of color and methods such as Delete(), but for me, it comes together.

    Any help would be appreciated.

    Try this as a way to solve the problem. It adds a new contains() method to the Array class.

    var doc = app.ActiveDoc,
        col  = doc.FirstColorInDoc
        keepColors = ["Black","White","Red","Green","Blue","Cyan","Magenta","Yellow","Dark Grey","Pale Green","Forest Green","Royal Blue","Olive","Salmon","Mauve","Light Salmon","Custom Color"];
    
    Array.prototype.contains = function (value) {
        var i;
        for (i = 0; i < this.length; i+=1) {
            if (this[i] === value) {
                return true;
            }
        }
    }
    
    while(col.ObjectValid()){
        if (!keepColors.contains(col.Name)) {
            col2 = col.NextColorInDoc;
            col.Delete();
            col = col2;
        }
        else {
            col = col.NextColorInDoc;
        }
    }
    
  • Need help with the Script to remove the option data download of a page

    Hi all

    I have a requirement where in I need to delete download option given specifically to a page for a particular set of reports. I wrote a java script...

    < script type = "text/javascript" >
    function RemoveOption()
    {
    TDS var = document.getElementsByTagName ('a');
    for (td var = 0; td < tds.length; td ++)
    {
    If (tds [td] .className! = "NQWMenuItem")
    {
    continue;
    }
    var tHTML is tds [td] .innerHTML;.
    tHTML = tHTML.replace ("download data","" ");
    TDS [td] .innerHTML = tHTML;
    }
    }
    Window.OnLoad = RemoveOption;
    < /script >

    that works very well up to a point every time IE it deletes a page load. but in case I have a view selector in a report or on a table whn I click the next Recordset it only gives me the desired result.

    Then...

    I was hoping that if someone has a better way to do it... If so can you please share it...


    Thanks in advance...

    Published by: Ashu M 25 May 2010 13:28

    Try to use the event window.onFocus instead.

    What about John
    http://obiee101.blogspot.com/

  • Remove the &amp; quot; Click here to turn on &amp; quot;

    I noticed that on my movies, when in a Web browser window, you place the cursor over them to "click to activate" them. How do you define the film if you don't have to do that? I know that's not my computers settings because other animations flash on other sites (e.g. xbox.com) you don't have to click on the movies out there.

    I know that this is not essential but its a little boring when moving the cursor over the film and a border appears round the film until u click on it.

    Any help?

    Oh found the answer

  • The Scripts PowerShell Script to remove AD Logon

    I'm trying to create a PowerShell script to remove the scripts of connection for all users in the AD.

    I'm trying to create a PowerShell script to remove the scripts of connection for all users in the AD.

    Hello

    Your question is addressed in these forums of consumers.

    Please use the following to ask this question.

    Windows 8 IT Pro category:

    http://social.technet.Microsoft.com/forums/en-us/category/w8itpro

    Concerning

  • How to remove the color swatches in java script

    Friends & expensive Tpk

    I would like the script to remove the nuances in the below:

    PositiveOvertracked (100,15,100,0)

    NegativeOvertracked (15,100,100,0)

    Is this possible?

    Thank you!

    Use the simple and straightforward code below. Replace with the color 'black '.

    mycolor = app.activeDocument.colors.item("PositiveOvertracked")
    mycolor1 = app.activeDocument.colors.item("NegativeOvertracked")
    mycolor.remove();
    mycolor1.remove();
    

Maybe you are looking for