Solved I need split one file, which contains multiple file structur

January 29, 2018 at 07:15:17
Specs: Windows 7
I need to split one file when ever the new line starts,which contains multiple file structure in the same file using batch script.

Important, that every sub file is separated by newline
so the data look like: test.csv

sno,employee name,address,location,zip code
1,aaaa,12/34,Hyderabad,500089
2,bbbb,12/35/44,chennai,500079
3,cccc,12/31/11,pune,500069

Cardnumber,cardname,card type,card limit
12345,visa,diamond,10000
2345,master,platinum,50000

Accno,bank name,branch code,Branch location
98765,sbi,23456,hyd
12457,citi,8765,usa
4444,axis,78767,India

and I need separate file like below
Test1.csv

sno,employye name,address,location,zipcode
1,aaaa,12/34,Hyderabad,500089
2,bbbb,12/35/44,chennai,500079
3,cccc,12/31/11,pune,500069

Test2.csv

Cardnumber,cardname,card type,card limit
12345,visa,diamond,10000
2345,master,platinum,50000

Test3.csv

Accno,bank name,branch code,Branch location
98765,sbi,23456,hyd
12457,citi,8765,usa
4444,axis,78767,india

Please help me to write the batch script for the above requirement. Thanks in Advance


See More: I need split one file, which contains multiple file structur

Report •

#1
January 29, 2018 at 08:49:02
✔ Best Answer
I tried a free piece of software called TextWedge - search for it on google and go download directly from sourceforge.

1. I created your csv file in C:\Test\test.csv file and
2. Extract archive, and open TEXTWEDGE.exe.
3. Go to Dialogs and then choose Configure Standard Splitting.
4. In the first field replace /file/<#>.Txt with C:\Test\test<#>.csv
Note: test<#>.csv changes based on the name of your file, just 1 # means the name is test followed by 1 character.
5. In the second field called "Chunks are limited by" write 1.
It's the number of lines that delimits the text you want to split. The number of lines will be discarded (removed)
6. Click OK, now go to File - Load & Split and browse to your file and open it. You can check the test folder.
In this example it contains 3 new csv files called test1, test2, test3 with those 3 chunks of information split from test.csv main file.


Report •

#2
January 29, 2018 at 19:27:13
Thank you for solution but we need to achieve through batch script.

Report •
Related Solutions


Ask Question