batch extract of file names from Excel

August 24, 2010 at 05:06:47
Specs: Windows 7
Hi all,

I'm new to the forum, and creating batch files so I'll try to be as precise as I possibly can...

I have an Excel file which has two columns of data.

The first column contains a reference number that I'd like to use as the naming convention for naming a text file that also needs to be created.

The second column contains the content that needs to be added to the text file once it has been created.

I need to create a batch file that will read from the Excel spread sheet and use the data in column one and use that to name a text file that also needs to be created and then read from the second column and use that data as the file content.

Can any one help?
Thank you in advance.
Mark


See More: batch extract of file names from Excel

Report •

#1
August 24, 2010 at 05:34:26
export the excel data in to a csv file. (comma as separator).

download gawk for windows then do this

c:\test> gawk.exe -F"," "{print $2 > $1\".txt\"}" file.csv

GNU win32 packages | Gawk


Report •

#2
August 24, 2010 at 10:15:40
No need for gawk in this case, I don't think.

Save as .csv and place the batch in the same directory

--
@echo off
for /f "tokens=1,2 delims=," %%a in (yourfile.csv) do echo %%b>>%%a.txt
exit
--


Report •
Related Solutions


Ask Question