file reading & processing
- To: mathgroup at smc.vnet.net
- Subject: [mg85078] file reading & processing
- From: Tibor <TiborNyers at gmail.com>
- Date: Sun, 27 Jan 2008 05:46:40 -0500 (EST)
Hi, my aim is to read a file in and than search it. A short part of the file: T,6,2,14,2 T,21,1,15,1 M,53,15,1,15 T,62,14,16,14 ... I want to separate it by the first letter of the rows. Mathematica code I use: A = Import["location/file.txt", "Table"] tMat=Cases[A, {T, ___}] mMat=Cases[A, {M, ___}] The problem: Import generates a format that I cannot handle properly: List[List["T,6,2,14,2"],List["T,21,1,15,1"],List["M, 53,15,1,15"],List["T,62,14,16,14"]] I tried ToExpression and StringToStream and others but it won't work. Thank you in advance