Computing.Net > Forums > Programming > create comma separated list of name

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

create comma separated list of name

Reply to Message Icon

Name: ammu
Date: September 10, 2008 at 08:43:33 Pacific
OS: Windows XP
CPU/Ram: 2gb
Comment:

Hi,

I need to list all xml files in a directory.

Ex:/Pathname has

09/08/2008 04:15 PM 189,961 a_2008-09-08-16-17-41.xml
09/09/2008 09:33 AM 189,961 b_2008-09-09-11-50-23.xml
09/09/2008 02:10 PM 933 c_2008-09-09-14-11-27.xml

I need this as a_2008-09-08-16-17-41.xml,b_2008-09-09-11-50-23.xml,c_2008-09-09-14-11-27.xml in a file.How to do this.Please advice



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 10, 2008 at 09:51:50 Pacific
Reply:

@echo off > new.csv
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in ('dir/b/a-d *.xml') do (
set /a N+=1
if !N! equ 1 ( set str=%%a
) else (
set str=!str!,%%a
)
)
echo !str! >> new.csv


=====================================
If at first you don't succeed, you're about average.

M2


0

Response Number 2
Name: ammu
Date: September 10, 2008 at 10:25:05 Pacific
Reply:

Thank You!

It is working


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: create comma separated list of name

Batch - list files only (no path) www.computing.net/answers/programming/batch-list-files-only-no-path/17113.html

Batch file variables www.computing.net/answers/programming/batch-file-variables/16799.html

Ping list of computers from a txt file www.computing.net/answers/programming/ping-list-of-computers-from-a-txt-file/19843.html