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!
        endlocal
    ))

    endlocal

Open in new window


Line 4001 is not empty look atached snapshot
EasyCapture2.jpg
maurice cristenAsked:
Who is Participating?
 
Bill PrewCommented:
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.


»bp
0
 
Bill PrewCommented:
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.

EE29068538.zip


»bp
0
 
Bill PrewCommented:
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...


»bp
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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
snap2.bmp
0
 
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
0
 
maurice cristenAuthor Commented:
IS THE SAME BAT i am 100% sure i have only this one so must be anotehr explination :P
0
 
Bill PrewCommented:
Okay, sorry I can't be of further help.  I'll be interested in what you find as the problem.


»bp
0
 
maurice cristenAuthor Commented:
anyway donest matter i will give you some points,plz help me with hobocopy
0
 
maurice cristenAuthor Commented:
thx
0
 
Bill PrewCommented:
I see no question about "hobocopy" (or "robocopy").

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



»bp
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.