Create, files based on column

I can't seem to figure out this simple problem:I have 1 file that has 4 columns:column 1= filenamecolumn 2-4=data

I need to take column1, create a file with that name, and then create 3 rows with columns 2-4.

for example the input.txt looks like:----------------------------file1,A,B,Cfile2,D,E,Ffile3,G,H,I----------------------------and I need a new file: "file1.txt" with the following text----------------------------ABC----------------------------I can create the new files with the batch below, but can't get the data to the right file:----------------------------for /f "tokens=1 delims=," %%a in (input.txt) do (set str=%%a@echo off>%%a.txt)-------------------------------------Thanks for the help.

You are real close!Set tokens=1-4, so you also create variable %%b, %%c, and %%d which will hold the values of columns 2-4. Now echo %%b, %%c, and %%d into file %%a using >> which will append to file %%a.

note: i've learned the hard way that:echo %%b > "%%a.txt"puts a space at the end of the line, which prob'ly not an issue in this post but ya never know.alternatives:echo %%b> "%%a.txt"or:> "%%a.txt" echo %%b

Perfect. Thanks a ton. This will save us hours of tedious work.I'm a civil engineer who has never done much computer programing, but have found that I waste a lot of time doing stupid things that very simple little batch files like this can do. Thanks again.

For those (if any) looking at this post here is the final batch that I put together (I like to see the finished product, it helps me):

The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this
site. Computing.Net and Purch hereby disclaim all responsibility
and liability for the content of Computing.Net and its accuracy.