Excel and PDF file exist

Hi,
I have many file paths in for each, is there an excel file at the end of these paths, I want to look at it, how can I provide it? I try “Path.Combine(sonyol, “* .xlsx”)” but this way gives me false consequences sonyol = a variable type string and ı have same ıssues in PDF format

hi @ulas.cinar08

you can use this function to check the extension:

Path.GetExtension(filePath).Equals(“.xlsx”)

and same for .pdf

Path.GetExtension(filePath).Equals(“.pdf”)

it didn’t work my file path “C:\Users\UCINAR\Desktop\ASDASFAZAMASQWEQWE\02_asdas\TB556\G_REF003_XCVBNMKUYTD WDE2ID 2EKRE R\04_KALITE\7_OLCUM_ RAPORLARI\KOMPLE”
and ı want to check is there any pdf file in “KOMPLE” maybe I didn’t explain myself sorry about that

Hi @ulas.cinar08

  1. Assign activity: directoryPath = “C:\Users\UCINAR\Desktop\ASDASFAZAMASQWEQWE\02_asdas\TB556\G_REF003_XCVBNMKUYTD WDE2ID 2EKRE R\04_KALITE\7_OLCUM_ RAPORLARI\KOMPLE”

  2. Assign activity: pdfFiles = Directory.GetFiles(directoryPath, “*.pdf”)

  3. If activity: pdfFiles.Length > 0
    Do something if there are PDF files in the directory
    Else
    Do something if no PDF files found in the directory
    End If

Hope it helps!!

Hi @ulas.cinar08

Use the below activity

Hope it works !!

1 Like

This path looks like a folder path to me,

you simply have to do,

directory.getfiles(folderpath,“*.pdf”).Count

The above expression will give you a integer count of pdf files in that folder.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.