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,133 of 42,547   
   Ferlin Short to Ferlin Short   
   Re: Add Carriage Return and Line Feed ev   
   20 May 15 14:01:32   
   
   From: ferlin.short@gmail.com   
      
   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   
      
   --- 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