home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.msdos.batch      Fun with MS-DOS batch files      42,547 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 41,129 of 42,547   
   foxidrive to Ferlin Short   
   Re: Add Carriage Return and Line Feed ev   
   21 May 15 11:26:25   
   
   From: foxidrive@server.invalid   
      
   On 21/05/2015 07:01, Ferlin Short wrote:   
   > On Friday, May 15, 2015 at 8:56:01 AM UTC-7, Ferlin Short wrote:   
   >> I'm struggling with writing a batch file that will take a filename as the   
   only parameter, reading the file contents and inserting a carriage return and   
   line feed every 128 characters   
   >   
   > For others looking for a solution to the same problem, I'll post what I was   
   able to figure out (with some help)   
   >   
   > @echo off   
   > setlocal enabledelayedexpansion   
   > set x=   
   > for /f "tokens=*" %%a in (%1) do set x=!x!%%a   
   > :NEXTLINE   
   >>> output.txt echo %x:~0,128%   
   > set x=%x:~128%   
   > if "%x%" neq "" goto :NEXTLINE   
   >   
      
   What is the makeup of your file?   
   Does it only have one line?   
   What length range is the line?   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca