A blank delete TXT small code

The following procedures save as bat, then TXT into this program, we can generate the txt without a blank line in the D disk, but there is a bug, if the txt has a blank line contains spaces, this code don't delete the blank line, could you tell me how to modify?
@echo off 
set n=1 
:3  
if exist d:\new_%n%.txt (set /a n+=1&goto 3) 
set file=%1  
for /f "usebackq delims=" %%i in ("%file%") do ( 
echo.%%i >>d:\new_%n%
)  
echo 
Finished processingļ¼

Started by Rod at February 07, 2016 - 7:23 PM

Halo nobody answer me??? 200 points.

Posted by Rod at November 24, 2016 - 4:27 PM

Soon after. .

Posted by Guy at November 26, 2016 - 4:41 PM

Batch processing... Can't write

Posted by Cyril at December 08, 2016 - 5:16 PM

You deal with this logic. I suggest that this place should use findstr, not for.

@echo off 
set file=%1  
findstr "[\s]" %file% >> d:\new_"%file%"


The file name of the rules of logic can be before you refer to your.

Posted by Harriet at December 18, 2016 - 6:02 PM

C# prepared by the following procedure:
Create a new console:
void Main(string[] Args)
{
System.IO.File.WriteAllLines(Args[1].Trim('\"'), System.IO.File.ReadAllLines(Args[0].Trim('\"')).Where(x => x.Trim() != "").ToArray());
}
Compiled 1.exe
Call
1.exe "c:\1.txt" "c:\2.txt"

Posted by Raymond at January 02, 2017 - 6:23 PM

Volume I really did not get too the console application, is generated directly on the line, can have the 1.exe.

Posted by Rod at January 06, 2017 - 7:08 PM

I am not the batch ah, what should how to change ah?

Posted by Rod at January 11, 2017 - 6:28 PM

Yes, VS C# of a new console, put into it.

Posted by Raymond at January 11, 2017 - 7:14 PM