Read block of file in Tcl



Hi,

I have an input file in the following format:
********************************
Name1
Name2
Row1 DEF 001
Row2 ABC DEG 003
Row3 EW EW 002
Row4 FF 0012
Row1 ADEF 1001
Row2 ARBC DEG 2003
Row3 EWW EW 0302
Row4 AB 0112
Name1
Name2
Row1 DSDEF 001
Row2 ABVC DEG 003
Row3 EDW EW 002
Row4 FVF 0012
Row1 AF 1001
Row2 ACRBC DEG 2003
Row3 ESWW EW 0302
Row4 AEB 0112
****************************************
I have to read this file and
--> if I get "Name1" in any of the line,
then I have to read the block of file from "Name1" to the first
occurrance
of "Row4".
--> If I get "Row1" after the above reading is done, then I have to
read
the block of file from "Row1" to the first occurrance of "Row4".

Can anyone help me out in doing this through TCL.

Thanks and regards,
Calvin

.



Relevant Pages

  • Comparing Columns and Counting
    ... Row2 - Impaired - Tested ... Row3 - Impaired - Not Tested ... Row1 - Impaired - Tested ... of the 2 drivers was impaired, ...
    (microsoft.public.excel.misc)
  • Re: Read block of file in Tcl
    ... > Row4 FF 0012 ... > Row1 ADEF 1001 ... > Row2 ARBC DEG 2003 ... > Row3 EWW EW 0302 ...
    (comp.lang.tcl)
  • Re: Same text in column as one
    ... Row2 Aaaaaaa ... Row4 Ddddddd ... Row3 Ccccccc ... Row6 Zzzzzzz ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Same text in column as one
    ... Row2 Aaaaaaa ... Row4 Ddddddd ... Row3 Ccccccc ... Row6 Zzzzzzz ...
    (microsoft.public.excel.worksheet.functions)
  • Same text in column as one
    ... Row3 Aaaaaaa ... Row4 Ccccccc ... Need formula in Sheet2 Column A from row2. ... Look for names in Sheet1 column W and put same company name as one text. ...
    (microsoft.public.excel.worksheet.functions)