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.  CSV directory name from the node.

    Employee
    Posted 05-12-2016 09:38

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

    Originally posted by: Jagdev

    Hi Experts,
    I have a graph which picks a file either it is excel or CSV. It work fine and pull data as per the format. We rename our file with carrier name e.g. abc_04052016. We need the name abc from the file name. If you check the filter node (Get Carrier) does that for Excel file. I want to pull the same for CSV format file. But it is throwing an error message. Please guide me for this. Attached is the graph for your reference.
    Regards,
    Jagdev
    Attachments:
    File_Format.brg


  • 2.  RE: CSV directory name from the node.

    Employee
    Posted 05-12-2016 10:55

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

    Originally posted by: prasmussen

    Hello,

    Try replacing your backslash with a forward slash. Put a filter node in with the following:

    override emit 'FileName'.replace("\\","/") as "FileName"

    If that doesn't work, what is the value of the filename that you are passing into the CSV node?


  • 3.  RE: CSV directory name from the node.

    Employee
    Posted 05-13-2016 02:47

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

    Originally posted by: Jagdev

    Hi,

    I am not sure if we can get filename in CSV node. Please let me know if there is a way to get the file name from the CSV node, because it is throwing me an error message that the Filename doesn't exist. Please guide me on this and let me know a way around on this.

    Regards,
    Jagdev


  • 4.  RE: CSV directory name from the node.

    Employee
    Posted 05-13-2016 05:57

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

    Originally posted by: ryeh

    In the CSV File node, go to the Optional tab and set the FilenameOutputField parameter to filename. Then you'll get the same behavior for both.


  • 5.  RE: CSV directory name from the node.

    Employee
    Posted 05-13-2016 06:38

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

    Originally posted by: Jagdev

    Thanks Ryeh,

    I fixed the error. Thanks for your above comments.

    Regards,
    Jagdev


  • 6.  RE: CSV directory name from the node.

    Employee
    Posted 05-13-2016 07:50

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

    Originally posted by: Jagdev

    Hi,

    I have one more query regarding the above graph. The switch node is the point of concerned now say, I have csv file and after the check it moves to csv folder down and keep the excel value 0 and takes time to load data in the CSV node. In the meantime the excel node's 0 value reaches the switch node and it execute(Switch node) and gives output of 0 value. which is wrong as per my requirement. Is there a way to disable the excel node in case the CSV file is find in the directory node. So that the switch node waits for the CSV data to complete its execution.

    Regards,
    Jagdev


  • 7.  RE: CSV directory name from the node.

    Employee
    Posted 05-13-2016 08:36

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

    Originally posted by: stonysmith

    Personally, I would solve the problem with the attached the graph.
    Create two "dummy" files somewhere on your server, one XLS, and one CSV
    They could be in some folder other than your base folder, but they both need to exist.
    Both of them should have the same headers, but no data records.

    With the attached code, it will read the files on both path(s) and concatenate the paths into a single result.
    If you have only an XLS in the upload folder, this will read the (real) XLS and the (dummy) XLS and concatenate it to the dummy CSV. You'll have the records from the real XLS. Vice versa for the CSV.

    ================
    I don't think you can get Switch (nor Bypass) to do what you wish here. Both Switch and Bypass operate on the concept of what CAN be "satisfied", or restated: what can have data. Bypass in particular will always take the first input unless that input is disabled. It will ONLY take the 2nd,3rd inputs if the first one has been disabled.

    I'm not sure, but it may well be that Switch will only make the decision between inputs after you've toggled its Event Input (complicated) - I don't think ordinary clocking (with metacheck) is going to do it for you.
    Attachments:
    File_Format.brg


  • 8.  RE: CSV directory name from the node.

    Employee
    Posted 05-16-2016 05:01

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

    Originally posted by: Jagdev

    Hi Stonysmith,

    Thanks for sharing the below information. It looks good when I have to deal with same set of column data every time. My column count & name will change for every file and creating the same for each seperate dummy file is not a good option. Is there any other way to deal with this situation.

    Regards,
    Jagdev