We recommend switching to the latest versions of Edge, Firefox, Chrome or Safari. Using Internet Explorer will result in a loss of website functionality.

unzipping using python node


1 comment

  • Avatar
    Adrian Williams

    The generic way to handle renaming a file in python is:
    import os
    os.rename(r'file path\OLD file name.filetype',r'file path\NEW file name.filetype')

    e.g. for Windows:
    import os
    os.rename(r'C:\Users\Bob\Desktop\Test\test_file.txt', r'C:\Users\Bob\Desktop\Test\new_test_file.txt')

    and for Linux:
    import os
    os.rename(r'/home/Bob/Test/test_file.txt', r'/home/Bob/Test/new_test_file.txt')

    The "r" in front of the file name is not strictly necessary with Linux since it uses forward slashes for the path separators rather than the Backslash with Windows. However, it is best practice to include it to make the code more portable.

    The import statement should be included at the start of your script. When using the Transform node it is best to include this in the ConfigureFields script as the import is then performed once rather than for each record.

    We understand you have had issues posting to the forum - were you using Internet Explorer 11 at the time? In common with many applications provided by third-party vendors, Zendesk announced earlier this year that they would cease support for IE11 at the end of this year and that new functionality may not work in IE11. Infogix recommend the use of Chrome with Analyze.

    Comment actions Permalink

Please sign in to leave a comment.