text file problem, I have many files that end up like this

text file problem, I have many files,i chosed to split thm in 4000 lines each
i use this small batch script to split every 4000 lines:

@echo off
    setlocal enableextensions disabledelayedexpansion

    set "nLines=4000"
    set "line=0"
    for /f %%a in ('type file.txt^|find /c /v ""') do set "fileLines=%%a"

    < "file.txt" (for /l %%a in (1 1 %fileLines%) do (
        set /p "data="
        set /a "file=1+line/%nLines%", "line+=1"
        setlocal enabledelayedexpansion
        >>"pass!file!.txt" echo(!data!


Open in new window

Line 4001 is not empty look atached snapshot
maurice cristenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewIT / Software Engineering ConsultantCommented:
I ran a test here on a test file and did not see the condition you are reporting.  Perhaps it is your input file, if you want to post that here (attach), and also attach (not paste) the actual BAT file (rename to TXT so it can upload) I will look at them to see if there is anything odd about them.

Here are the files from my test.


Bill PrewIT / Software Engineering ConsultantCommented:
Also, that BAT file is the hard and slow way to split a file, you might take a look at the Unix split command.  A Windows port can be obtained as part of this package:

Or with just a tiny bit of work you can grab a much more current version of these unix utils ported to windows from the portable version of GIT for Windows:

Given some of the text file manipulations you seem to do having some of these tools might come in handy...

maurice cristenAuthor Commented:
In my laptop i opened ur .zip archive and run pass1.txt,everything seems ok when i put that file in my other pc , look snp
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

maurice cristenAuthor Commented:
On my rdp not ok in my laptop ok in my pc not ok ,why? i really not understand i inspect the entire file i clean it etc everything seems ok
Bill PrewIT / Software Engineering ConsultantCommented:
Try copying the BAT file from the machine where it works okay (laptop) to the other machines, maybe a different there.

Other than that it's something different in the environments but I can't diagnose that.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
maurice cristenAuthor Commented:
IS THE SAME BAT i am 100% sure i have only this one so must be anotehr explination :P
Bill PrewIT / Software Engineering ConsultantCommented:
Okay, sorry I can't be of further help.  I'll be interested in what you find as the problem.

maurice cristenAuthor Commented:
anyway donest matter i will give you some points,plz help me with hobocopy
maurice cristenAuthor Commented:
Bill PrewIT / Software Engineering ConsultantCommented:
I see no question about "hobocopy" (or "robocopy").

Also, could you revist this question and act on it please:

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.