LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Emit a Windows path - getting an error

    Employee
    Posted 09-24-2014 10:02

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: the1don

    I have two parameters set up

    WinFileLocation - \\MyPath\level2\level3
    ExcelName - Output_File

    In the emit area I have
    emit
    vkey
    ,Data as "NOTES"
    ,"{{^WinFileLocation^}}" +"{{^ExcelName^}}" +str(date()) as "Order File Name"
    .......

    It errors with
    Invalid escape sequence in string ["\\MyPath\level2\level3"] at line 32
    When I take the "{{^WinFileLocation^}}" + out the graph runs without any issues
    Line 32 is the line the command is on.
    I was told I would need to add two additional \ in the front but I can not get that to work either
    Any ideas?

    Thank you
    Don


  • 2.  RE: Emit a Windows path - getting an error

    Employee
    Posted 09-24-2014 10:07

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Hi,

    "\" is the escape character. For example, a newline would be "\n".
    In order to output the literal "\" you would need to escape each of these using "\\".

    This is discussed in some detail - with other potential ways to work around the problem in this thread:
    community.lavastorm.com/threads/3124-getting-error-when-trying-to-access-the-graph-parameter-from-filter-node

    Hope this helps,
    Tim.


  • 3.  RE: Emit a Windows path - getting an error

    Employee
    Posted 09-24-2014 10:11

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ejones

    You'll need the double backslash EVERYWHERE it is in the file path and name. Alternatively you can use a forward slash (/) instead of the backslash.

    Note you will need this delimiter between the WinFileLocation and the ExcelName as well. And I am wondering if you need the drive letter as well, I'm guessing it works without it.

    So try:

    WinFileLocation - \\MyPath\\level2\\level3
    ExcelName - Output_File
    ...
    emit
    ...
    ,"{{^WinFileLocation^}}" +"\\" + "{{^ExcelName^}}" +str(date()) as "Order File Name"


    OR (combining several changes at once) try:

    WinFileLocation - /MyPath/level2/level3
    ExcelName - Output_File
    ...
    emit
    ...
    ,"C:/{{^WinFileLocation^}}/{{^ExcelName^}}" +str(date()) as "Order File Name"


  • 4.  RE: Emit a Windows path - getting an error

    Employee
    Posted 09-24-2014 10:14

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: the1don

    Thank you Tim. with your help I got it working. I had to change the parameter to \\\\MyPath\\level2\\level3.

    I appreciate the quick response.
    Don


  • 5.  RE: Emit a Windows path - getting an error

    Employee
    Posted 02-14-2015 13:29

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: ryeh

    For future reference, I add the following example here. I didn't find out about this thread until after I made it!