Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > MSDOS Programmer > Re: Extract Rec...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 477 of 494
Post > Topic >>

Re: Extract Records with DOS

by ArarghMail801NOSPAM@[EMAIL PROTECTED] Jan 24, 2008 at 08:54 PM

On Thu, 24 Jan 2008 14:51:48 -0800 (PST), samuel.k.silver@[EMAIL PROTECTED]
>I have a large file with  millions of records and I have to clean it
>up and delete all lines that do not start with certain string (let's
>say XYZ).
>Can this be done in DOS?
>Any suggestions on what approach/tools I can take here.

(untested)
Assuming a text file(under 2 gig in size), in QBasic:

open "<infile>" for input as #1
open "<outfile>" for output as #2

while not eof(1)

  line input #1,i$

' keep lines that start with "<str in question>"
  if left$(i$,<len of str>) = "<str in question>" then print #2,i$

' if that string is "XYZ" : if left$(i$,3) = "XYZ" then print #2,i$

wend
close
system
-- 
ArarghMail801 at [drop the 'http://www.'
from ->] http://www.arargh.com
BCET Basic Compiler Page: http://www.arargh.com/basic/index.html

To reply by email, remove the extra stuff from the reply address.




 5 Posts in Topic:
Extract Records with DOS
samuel.k.silver@[EMAIL PR  2008-01-24 14:51:48 
Re: Extract Records with DOS
"Jim Langston"   2008-01-24 16:38:58 
Re: Extract Records with DOS
ArarghMail801NOSPAM@[EMAI  2008-01-24 20:54:27 
Re: Extract Records with DOS
"Todd Vargo" &l  2008-01-25 05:15:10 
Re: Extract Records with DOS
ArarghMail801NOSPAM@[EMAI  2008-01-25 01:54:18 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat May 17 2:13:41 CDT 2008.