Announcement

Collapse
No announcement yet.

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.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    650 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    370 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    109 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    574 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    577 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X