(* Inspct.nb ------------------------------------------------------------ *) (* Used to inspect the contents of a file. Displays a sample of the file including at least the first 2 and last 2 lines. *) (* User sets the directory, the input family and the size of posets and the number of pairs of lines to be displayed beyond the first and last 2. *) (* Change Directory: *) SetDirectory["G:/.isis/home/c/a/cagann/public_html/Posets"]; (* Change input family: *) fam = "Stdpsts/stdpsts"; (* Change poset size: *) nc = 1; (* Input file is read in and the length is reported. *) (* Need ReadList[ ,String] for stdisos* and lookups*. *) inptfl = ReadList[StringJoin[fam, ToString[nc]],String]; leng = Length[inptfl]; Print[StringJoin["Length of file = ",ToString[leng]]]; (* End of 1st cell. *) (* Change number of additional pairs of lines to be displayed. *) addpairs = 0; (* A sample of the contents of the input file is displayed. *) Print["Lines 1 and 2:"]; Print[inptfl[[1]]]; Print[inptfl[[2]]]; skp = Floor[(leng-4)/(addpairs+1)]; ind = 2 + skp; While[addpairs \[NotEqual] 0, Print[StringJoin["Lines ",ToString[ind]," and ",ToString[ind+1],":"]]; Print[inptfl[[ind]]]; Print[inptfl[[ind+1]]]; ind = ind+skp; addpairs--; ] Print[StringJoin["Lines ",ToString[leng-1]," and ",ToString[leng],":"]]; Print[inptfl[[leng-1]]]; Print[inptfl[[leng]]]; (* End of 2nd/last cell. *)