[Tutor] Extract Block of Data from a 2D Array

Stephen P. Molnar s.molnar at sbcglobal.net
Fri Mar 31 10:39:10 EDT 2017


On 03/31/2017 10:29 AM, Alan Gauld via Tutor wrote:
> On 31/03/17 13:19, Stephen P. Molnar wrote:
>> I have a block of data extracted from a quantum mechanical calculation:
>
> How is this data stored? On paper? In a database? In XML? A CSV file?
> Plain text? The answer to that will go a long way to pointing you in the
> right direction for a solution.
>
>> CARTESIAN COORDINATES (A.U.)
>> ----------------------------
>>     NO LB      ZA    FRAG     MASS         X           Y           Z
>>      0 C     6.0000    0    12.011   -3.265636    0.198894    0.090858
>>      1 C     6.0000    0    12.011   -1.307161    1.522212    1.003463
>>      2 C     6.0000    0    12.011    1.213336    0.948208   -0.033373
>>      3 N     7.0000    0    14.007    3.238650    1.041523    1.301322
>>      4 C     6.0000    0    12.011   -5.954489    0.650878    0.803379
>>      5 C     6.0000    0    12.011    5.654476    0.480066    0.013757
>>
>> where the number of lines depends upon the molecule being considered.
>>
>> I want to extract the block of data starting on line 4 and column 4.
>
> A block of data needs a start and end. Where is the end?
> Also which of the above lines is line 4?
> I'd read it as the one starting the actual raw data values.
> But it could be the 4th line of values that you want?
>
> It might help to know the OS you are using too because Unix
> in particular has some OS level tools that might simplify
> preparing the data.
>

Sorry about the omission.  The data is in a tab separated file.

-- 
Stephen P. Molnar, Ph.D.		Life is a fuzzy set
www.molecular-modeling.net		Stochastic and multivariate
(614)312-7528 (c)
Skype: smolnar1


More information about the Tutor mailing list