Remove first 9 Charters of every line in text file

Remove first 9 Charters of every line in text file

Post by Yogi_Bear_ » Wed, 10 Sep 2003 01:34:43


I have a 115,000 line text file, how do you remove the first 9 characters
from every line, also how would you remove any trailing spaces from a line,
without removing the carrige return?
 
 
 

Remove first 9 Charters of every line in text file

Post by Steve Fult » Wed, 10 Sep 2003 01:48:19


set fso=createobject("scripting.filesystemobject")
set input=fso.opentextfile("input.file",1,false)
set output=fso.opentextfile("ouput.file",2,true)
do until input.atendofstream
output.writeline rtrim(mid(input.readline(),10))
loop
input.close
output.close

--
Steve

Life is too important to be taken seriously. -Oscar Wilde

 
 
 

Remove first 9 Charters of every line in text file

Post by Dr John St » Wed, 10 Sep 2003 07:22:22

JRS: In article < XXXX@XXXXX.COM >, seen in

< XXXX@XXXXX.COM > posted at Mon, 8 Sep 2003 12:34:43 :-

Granted this is a VBS group; but I'd do it at a DOS prompt :

type file.ext | COLS 10- \0 > file.new

Get COLS via sig line 3 below.

--
John Stockton, Surrey, UK. ?@merlyn.demon.co.uk DOS 3.3, 6.20; Win98. Web< http://www.yqcomputer.com/ >/> - FAQqish topics, acronyms & links.
PAS EXE TXT ZIP via< http://www.yqcomputer.com/ ;m>
My DOS< http://www.yqcomputer.com/ ;m> - also batprogs.htm.