Batch For commands - each Character

September 13, 2010 at 16:10:29
Specs: Multiple OS, -
I want a batch to, after a thousand Characters , to out file contents to File2.txt
Is is what i have so far...

@echo off
setlocal enabledelayedexpansion
set/a N=0
set/a B=1
Echo Set Old file
set /p "file=>> "
echo Set new file
set /p "new=>> "
:start
for /f "usebackq delims=" %%a in (!file!.txt) do (
set/a N=!N!+1
if "!N!"=="!B!00" set/a B=!B!+1
echo %%a>> !new!-!B!.txt
)


See More: Batch For commands - each Character

Report •


#1
September 13, 2010 at 18:36:16

download coreutils for windows then do this


 tail --bytes=+1000 file > newfile

GNU win32 packages | Gawk


Report •

#2
September 13, 2010 at 19:11:44
I tried downloading that program before and it didnt work...
i would like it to be in batch though... because i understand batch better then any other programming.

Report •

#3
September 13, 2010 at 19:58:05
That is batch. Tail is an add-on command. You can run that from the prompt or a batch file.

Can I put a question here?


Report •

Related Solutions

#4
September 13, 2010 at 20:05:58
i thought so... I have windows 7 though...
OK i will try again though...

BUT... how do i get it to work?


Report •

#5
September 13, 2010 at 20:07:00
OR...
can someone tell me how to allow FOR command to got though each Character and not each word?

Report •

#6
September 13, 2010 at 20:32:46
>> BUT... how do i get it to work?

its just a .exe file. you use it just like any other .exe. Store in your system32, or some other directory your %PATH% variable points to.

GNU win32 packages | Gawk


Report •

#7
September 14, 2010 at 16:41:49
Hi
Do you want to ignore spaces and does 1000 chars equal so many lines or can it be
part way along a line.
How many charactors can there be on one line.
If its so many lines you could use the SKIP command in the FOR loop to skip a number of lines.

Report •


Ask Question