dirlist Function

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
khurshid.arshad
Posts: 571
Joined: July 9th, 2012, 11:32 am
Location: Islamabad, Pakistan

dirlist Function

Post by khurshid.arshad »

Dear Team

I am using dirlist function but it is not working on my end. For reference a small application is attached.

The scenario is that I have number of files against each HH. When i try to know the total number of files against a specific HH id it shows 0.

Please see my syntax in attached application.

Please use 1234 for countfilenum Identification and HH ID is 1 to 3
In Name you can type anything.

thanks

a.
Attachments
countfiles.rar
(4.28 KiB) Downloaded 132 times
sherrell
Posts: 397
Joined: April 2nd, 2014, 9:16 pm
Location: Washington, DC

Re: dirlist Function

Post by sherrell »

Hi Arshad,

You were almost there. You just need to pass in the folder name and file name as separate arguments. The following would accomplish this (I'm separating the folder name from the file name wildcard for clarity, not necessity):
PROC GLOBAL

list string
filelisting;
string FNwildcard, FolderName;

PROC COUNTFILENUM_FF

PROC NAME

    FolderName =
"..\102_Data\";
    FNwildcard =
edit("9999",COUNTFILENUM_ID) +"-"+ edit("99999",HH_ID) + "*.txt";

   
dirlist(filelisting, FolderName, FNwildcard);
Sherrell
Post Reply