Subscribe Bookmark RSS Feed

Data Manipulate

hupin

Community Trekker

Joined:

Aug 11, 2013

Hi, I'm quite new in JMP. below is my raw data, they are squeeze in the same cell, each row is one lot information

any solotion to split and organize in nice order as below ? many thanks

Raw Data before:

4000_Capture.PNG

re-organized raw data that I intend to get :

3999_Capture2.PNG

2 REPLIES
ms

Super User

Joined:

Jun 23, 2011

With such data, I think I would give the text file a grep-treatment before importing to JMP.

However try the script below. It should produce a new table with the data organized in different columns. It is assumed that there are no missing data, i.e. always the same number of entries in the same order.

dt = Current Data Table();

col = Column( dt, "Raw Data" );

//Make list of names and data

L = Words( col[1], "();" );

//Define positions of data in L

m_data = (1 :: N Items( L ) / 2) * 2;

// Make list of column names

names = L[m_data-1];

n = N Items( names );

For( i = 1, i <= n, i++, names[i] = Trim( names[i] ) );

//Build matrix of all data

m = [];

For Each Row(

  L = Words( col[], "();" );

  L_data = L[m_data];

  For( i = 1, i <= n, i++,

  L_data[i] = Num( L_data[i] )

  );

  m ||= Matrix( L_data );

);

//Make new table

As Table( Transpose( m ), <<column names( names ) )<<set name("Organized Data");


hupin

Community Trekker

Joined:

Aug 11, 2013

thanks . but I'm not good at JSL, takes some time to digest