Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Printing several lines

 [1/3] from: rick_falls:hotmai:l at: 13-Jul-2001 20:54


Hello, Could someone tell me how to print several lines once a search word has been found in a text file.I am searching a text file of saved e-mails and would like to print the line containning the search word and the next 3 or 4 lines of info. Thanks Rick ************What I have so far************************************* REBOL[ Title: "Database search" Date: 13-July-2001 Version: 1.0.0 Purpose: "E-mail database search" ] prin "Enter search word............." name: input customers: read/lines %test3.xml foreach customer customers [if find customer name [ print customer]]

 [2/3] from: ryanc::iesco-dms::com at: 13-Jul-2001 14:06


try it like this foreach customer customers [ if find customer name [ print-lines: 4] if print-lines > 0 [ print customer print-lines: print-lines - 1 ] ] rick falls wrote:
> Hello, > Could someone tell me how to print several lines once a search word has been
<<quoted lines omitted: 19>>
> [rebol-request--rebol--com] with "unsubscribe" in the > subject, without the quotes.
-- Ryan Cole Programmer Analyst www.iesco-dms.com 707-468-5400

 [3/3] from: rick_falls::hotmail at: 13-Jul-2001 21:23


Perfect thanks!

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted