Link to home
Start Free TrialLog in
Avatar of DancingFighterG
DancingFighterG

asked on

Listing of contents in a .csv file

Hello, I'm trying to modify the following script so that I can produce a .csv from the files that I am getting a count for. Currently part of the list shows up in the launch of the batch job but I would like to get the full list in a .csv file. The script right now just gives me a count. Here is the code to modify:

@ECHO OFF

SETLOCAL 
SETLOCAL ENABLEDELAYEDEXPANSION

SET count=0 
for %%o IN (\\govnas03\TS_Alfresco_TABS\Shipment\*.*) DO ( 
      echo %%o 
      SET /A count=count + 1 
)

echo %count% > logfile.txt

IF "%count%"=="100" ECHO NET STOP MyApp

ENDLOCAL ENABLEDELAYEDEXPANSION 
ENDLOCAL
pause

Open in new window

Avatar of DancingFighterG
DancingFighterG

ASKER

i believe that I found a partial script that will give me the following:

Fields:

File name (this can include commas!)
Creation date
Modified date

(FOR /f "delims=" %%a IN ('dir /b /a-d') DO (
    FOR /f "tokens=1-3*" %%x IN ('dir /a-d /tc "%%~a"^|findstr "^[0-9]"') DO (
        ECHO "%%a",%%~ta,%%x %%y %%z
    )
Avatar of Bill Prew
What attributes of each file do you want included?

~bp
Now I just need to see how to apply this script to my current script
Hello Bill,

Currently the script is just getting the count from the location. I just want to grab the file names and place them in the .csv. Getting creation and modified date would be great if we can do it
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Works great. Thanks!!
Great, glad that helped.

~bp
great quick solution!!