Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Reading file names only and compare them

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Reading file names only and compare them

    Hi,

    I am trying to read only file names not the full path and I am trying to compare them between them. for example, if there are 3 file in a directory A, B and C. I am trying to read A, B, C as string and if my barperiod is equal to A, then I want to print B, nothing else. I have tried many ways available, but stuck here. Could not find anything related in help guide. Can anyone guide me to the right direction please?

    #2
    Hello asmmbillah,

    Thank you for the post.

    This would not really be a NinjaScript question so you won't find anything on this in the help guide. For this you could search online for "C# get filename from path" to get some suggestions. You essentially just need to take the filename out of the paths you found which there are many ways to do.

    Here is one way using Path.GetFileName() https://docs.microsoft.com/en-us/dot...tframework-4.5

    You could make another list of just names or do whatever you needed once you strip the path and get just the name. If you need to also strip the extension, you could search for "C# get filename without extension".

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by trilliantrader, Today, 08:16 AM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_BrandonH  
    Started by bill2023, Yesterday, 08:51 AM
    3 responses
    20 views
    0 likes
    Last Post bltdavid  
    Started by yertle, Today, 08:38 AM
    0 responses
    4 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by Mestor, 03-10-2023, 01:50 AM
    15 responses
    379 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by samish18, Yesterday, 08:57 AM
    10 responses
    28 views
    0 likes
    Last Post samish18  
    Working...
    X