Batch For commands - each Character

Score
0
Vote Up
September 13, 2010 at 16:10:29 Pacific
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
)


Reply ↓  Report •


#1
Vote Down
Score
0
Vote Up
September 13, 2010 at 18:36:16 Pacific


download coreutils for windows then do this


 tail --bytes=+1000 file > newfile

GNU win32 packages | Gawk


Reply ↓  Report •

#2
Vote Down
Score
0
Vote Up
September 13, 2010 at 19:11:44 Pacific

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.

Reply ↓  Report •

#3
Vote Down
Score
0
Vote Up
September 13, 2010 at 19:58:05 Pacific

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?


Reply ↓  Report •

#4
Vote Down
Score
0
Vote Up
September 13, 2010 at 20:05:58 Pacific

i thought so... I have windows 7 though...
OK i will try again though...

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


Reply ↓  Report •

Related Posts

#5
Vote Down
Score
0
Vote Up
September 13, 2010 at 20:07:00 Pacific

OR...
can someone tell me how to allow FOR command to got though each Character and not each word?

Reply ↓  Report •

#6
Vote Down
Score
0
Vote Up
September 13, 2010 at 20:32:46 Pacific

>> 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


Reply ↓  Report •

#7
Vote Down
Score
0
Vote Up
September 14, 2010 at 16:41:49 Pacific

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.

Reply ↓  Report •

Reply to Message Icon Start New Discussion
« interaction with my dice ... append txt files and form... »

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.

Ask the Community!
Describe your Problem
Example: Hard Drive Not Detected on My PC