Import x and y values from the text file to jmp tableHi,
Reading each line in text file and import each string as a separate row in the jmp data table
Advanced Statistical ModelingData AccessMass CustomizationRe: Import x and y values from the text file to jmp table and create wafer mapThanks Jarmo.
Re: Import x and y values from the text file to jmp table and create wafer mapHere is complete example for this which uses associative array to store information about the wafer and builds jmp table from the text file.
View more...
I did also notice that seems like JMP doesn't behave correctly with Value Labels when "." is one of the values which is being labeled. I'll report this as a bug when I have time
View more...
Names Default To Here(1);
dt = New Table("Untitled",
Add Rows(4),
New Column("Column 1",
Character,
"Nominal",
Value Labels({"." = "MISSING", "A" = "AAA", "B" = "BBB", "C" = "CCC"}),
Use Value Labels(1),
Set Selected,
Set Values({"A", "B", ".", "C"})
)
);
Names Default To Here(1); dt = New Table("Untitled", Add Rows(4), New Column("Column 1", Character, "Nominal", Value Labels({"." = "MISSING", "A" = "AAA", "B" = "BBB", "C" = "CCC"}), Use Value Labels(1), Set Selected, Set Values({"A", "B", ".", "C"}) ) );
Re: Import x and y values from the text file to jmp table and create wafer mapAgain, reminder to use scripting index and jmp help. They are usually best resources to learn this type of JMP Scripting
Names Default To Here(1);
example_str = "\[
WAFER_MAP = {
WAFER_ID = "ABC"
A B C = 123
]\";
example_list = Words(example_str, "\!N");
Show(example_list);
Remove From(example_list, 1); // drop first index. Why it is fine in this case?
// loop over lines until "MAP = {" I'll just use hardcoded index for example
// I'll also save values to variables
// but associative array would be better in this case
wafer_id_line = example_list[1];
Show(wafer_id_line);
wafer_id = Word(2, wafer_id_line, "="); // you might have to remove extra quotes
show(wafer_id);
example_aa = Associative Array();
//adding values to associative array could be done with something like
example_aa["WAFER_ID"] = Word(2, wafer_id_line, "="); // you might have to remove extra quotes
show(example_aa);
Re: Import x and y values from the text file to jmp table and create wafer mapThank Jamo @jthi for letting me know what I was missing. I knew I was close. Can you share a example code just so I can refer? I am still learning how to play with strings
Re: Import x and y values from the text file to jmp table and create wafer mapI would change method if you want the other information too. As the data in the file has new data on each line (except for wafermap) I would use Words() and split on row change (you can still look for when wafermap starts by using Contains from the list Words() produces, but it is index in a list, not in string). Then I would add the information to associative array to make accessing it easier (this will require some looping and more Words() usage))
Re: Import x and y values from the text file to jmp table and create wafer mapHope you are doing well @jthi,!
Real quick question on this discussion-
I would also like to import all the strings from the txt file in the jmp data table including the header information. The final data table should contain all the strings and each character should be treated as a separate word. It should look like this.

The logic that you suggested doesn't work after row 13. Any help would be much appreciated
map_str =
"\[
WAFER_MAP = {
WAFER_ID = ""
BIN G = "Passing"
MAP = {
.....GGG.....
....BGGGG....
...BGGGGGG...
..GGGGGGGGG..
.GGGGGGBBGGG.
GGGGGGGBBGGGB
GGGGGGGGGGGGB
GGGGGGGGGGGGB
.GGGGGGGGGGG.
..GGGGGGGGG..
...GGGGGGG...
....GGGGG....
.....GGG.....
}
}
]\";
l = Words( map_str, "\!N" );
rowc = N Items( l );
colc = N Items( Words( l[1], "" ) );
dt = New Table( "Summary Bins",
Add Rows( rowc * colc ),
New Column( "X coord", Numeric, Ordinal ),
New Column( "Y coord", Numeric, Ordinal ),
New Column( "Bins", Character, Nominal, Label( 1 ) )
);
Try(
For Each( {line, idx}, l,
cur_rows = ((idx - 1) * colc :: (idx * colc - 1)) + 1;
dt[cur_rows, "X coord"] = ((1 :: colc))`;
;
dt[cur_rows, "Y coord"] = (J( 1, colc ) * (idx))`;
dt[cur_rows, "Bins"] = Words( line, "" );
)
);Thanks for your time!
Re: Import x and y values from the text file to jmp table and create wafer mapYou can use Contains to skip first "MAP = {" or search from end (read scripting index...)

Re: Import x and y values from the text file to jmp table and create wafer map@jthi
There are two strings containing "MAP = {" highlighted below:

I tried using & statement to not select first one but it doesn't work.
demo_str = Load text file("New wafer map.txt");
a = Contains(demo_str,"MAP = {") & Contains(demo_str,"WAFER_MAP = {") ==0; // get the location of the string "MAP ={"
Re: Import x and y values from the text file to jmp table and create wafer mapYou could try Contains with "MAP = {". This should give you the location of "MAP = {" in the string and then use that knowledge with Substr to get what you want. Also check scripting index (and possibly JMP Help which you can open from Scripting Index) to understand how Substr (and other functions) work.
Re: Import x and y values from the text file to jmp table and create wafer mapYou could try Contains with "MAP = {". This should give you the location of "MAP = {" in the string and then use that knowledge with Substr to get what you want
Re: Import x and y values from the text file to jmp table and create wafer map@txnelson ,
Your approach works if the pattern in the first row matches with the contain statement. I have several wafer maps which won't have same patterns. The only similarity is the wafer pattern starts at row number 21 in the text file. Is there a way to define the row number where the script will start reading?. I have attached a wafer map text file for reference (better view on note pad ++)
Re: Import x and y values from the text file to jmp table and create wafer mapmap_str = Substr(
demo_str,
Contains( demo_str, ".X." ),
Length( demo_str ) - Contains( demo_str, ".X." ) -1
);
Note: Look in the Scripting Index for definition and examples for the Stbstr() function
Re: Import x and y values from the text file to jmp table and create wafer mapThat's good explanation @jthi .
Quick question:
The below statement will start reading data from second row of the list. I don't want to read the last row which contains brace "}".
How can I define the end line in the script
map_str = Substr(demo_str, Contains(demo_str, ".X."));
Re: Import x and y values from the text file to jmp table and create wafer mapYou need to manipulate the string you get from Load Text File() in such a way that you end up with string which contains only the wafermap part of the text file. This won't give final string needed but gives one idea what you could do. See Scripting Index (and JMP Help) on how Substr and Contains work. It also has one option on using Words and Contains, which also needs some modifications to get correct list.
Names Default To Here(1);
demo_str = "SOMETHING
TEXT
EXAMPLE
MAP = {
.X.
XXX
.X.
}";
map_str = Substr(demo_str, Contains(demo_str, "MAP = {"));
show(map_str);
stop();
demo_list = Words(demo_str, "\!N");
map_start = Contains(demo_list, "MAP = {");
map_list = demo_list[map_start::N Items(demo_list)];
show(map_list);
Re: Import x and y values from the text file to jmp table and create wafer mapSorry to bother you again. I tried substr but there's something not correct in the code. If you could modify, it would be great
map_str = Load Text File();
l = Words( map_str, "\!N" );
rowc = N Items( l );
colc = N Items( Words( l[21], "" ) ); //// edits
dt = New Table( "Untitled",
Add Rows( rowc * colc ),
New Column( "X", Numeric, Continuous ),
New Column( "Y", Numeric, Continuous ),
New Column( "bin", Character, Nominal, Label( 1 ) )
);
For Each( {line, idx}, l,
cur_rows = ((idx - 1) * colc :: (idx * colc - 1)) + 1;
dt[cur_rows, "X"] = ((1 :: colc))`;
dt[cur_rows, "Y"] = (J( 1, colc ) * (idx))`;
dt[cur_rows, "bin"] = substr( line, 1 );
);
Re: Import x and y values from the text file to jmp table and create wafer mapYou should use some method to get only the wafermap (if you only care about it). Currently you are using the whole text file. Some options for that are
- Regex
- Substr with Contains
- Words and split on {}
- Words and split on row change and combine that with Contains to
- hard coding lines and getting wafermap based on those (usually very bad idea)
Re: Import x and y values from the text file to jmp table and create wafer map@jthi
Just a quick question
The actual text file contains wafer information in the beginning. I want to store the data from row 21. I modified jsl as below. It does read as expected. Any suggestions?

map_str = Load Text File();
l = Words( map_str, "\!N" );
rowc = N Items( l );
colc = N Items( Words( l[21], "" ) ); //// edits
dt = New Table( "Untitled",
Add Rows( rowc * colc ),
New Column( "X", Numeric, Continuous ),
New Column( "Y", Numeric, Continuous ),
New Column( "bin", Character, Nominal, Label( 1 ) )
);
For Each( {line, idx}, l,
cur_rows = ((idx - 1) * colc :: (idx * colc - 1)) + 1;
dt[cur_rows, "X"] = ((1 :: colc))`;
dt[cur_rows, "Y"] = (J( 1, colc ) * (idx))`;
dt[cur_rows, "bin"] = Words( line, "" );
);
Re: Import x and y values from the text file to jmp table and create wafer mapIt's a masterpiece. Thank you very much! :grinning_face:
Re: Import x and y values from the text file to jmp table and create wafer mapUsing simpler table
Names Default To Here(1);
// Simple example table
dt = New Table(
"Untitled",
Add Rows(9),
New Column("X", Numeric, "Continuous", Format("Best", 12), Set Values([1, 2, 3, 1, 2, 3, 1, 2, 3])),
New Column("Y", Numeric, "Continuous", Format("Best", 12), Set Values([1, 1, 1, 2, 2, 2, 3, 3, 3])),
New Column("bin", Character, "Nominal", Set Values({".", "X", ".", "X", "X", "X", ".", "X", "."}))
);
//empty string initialization
str = "";
// get unique values for Y
// I will use Associative array instead of Summarize to keep correct format of values
// Summarize would change them to strings
y_uniq = Associative Array(:Y) << get keys;
For Each({cur_y}, y_uniq,
cur_line_rows = Loc(dt[0, "Y"], cur_y); // Loc() with datatable subscripting
line_bins = dt[cur_line_rows, "bin"]; // more datatable subscripting
bin_str = Concat Items(line_bins, "");
str = str || bin_str || "\!N";
);
// remove extra whitespace
str = Trim Whitespace(str);
Write(str);


Re: Import x and y values from the text file to jmp table and create wafer mapAppreciated @jthi
I am new to JSL coding. Can you share an example? Just as a reference
Re: Import x and y values from the text file to jmp table and create wafer mapInitialize empty string, loop over the tables Y values in order, get row numbers for current y, use those row numbers to get bins, add those bins to initialized string (Concat Items() should help with this), add row change and continue to next Y. After looping trim whitespaces if needed.
Re: Import x and y values from the text file to jmp table and create wafer mapIt works like charm. Thanks alot @jthi,
I'm trying to import the words from the text file to jmp data table, and then assign a different letters to those bins in the jmp table and then convert back to text file with the original formatting
map_str =
".....GGG.....
....BGGGG....
...BGGGGGG...
..GGGGGGGGG..
.GGGGGGBBGGG.
GGGGGGGBBGGGB
GGGGGGGGGGGGB
GGGGGGGGGGGGB
.GGGGGGGGGGG.
..GGGGGGGGG..
...GGGGGGG...
....GGGGG....
.....GGG.....";
How do I convert the data table X , Y and bins back in the text file format with the formatting maintained. Any suggestion?
Re: Import x and y values from the text file to jmp table and create wafer mapI cannot share the code I use but here is a quick example with some ideas
Names Default To Here(1);
// load text file
// parse interesting things
// get map to string
map_str =
".....GGG.....
....BGGGG....
...BGGGGGG...
..GGGGGGGGG..
.GGGGGGBBGGG.
GGGGGGGBBGGGB
GGGGGGGGGGGGB
GGGGGGGGGGGGB
.GGGGGGGGGGG.
..GGGGGGGGG..
...GGGGGGG...
....GGGGG....
.....GGG.....";
l = Words(map_str, "\!N");
rowc = N Items(l);
colc = N Items(Words(l[1], ""));
dt = New Table("Untitled",
Add Rows(rowc * colc),
New Column("X", Numeric, Continuous),
New Column("Y", Numeric, Continuous),
New Column("bin", Character, Nominal, Label(1))
);
For Each({line, idx}, l,
cur_rows = ((idx - 1) * colc::(idx * colc - 1)) + 1;
dt[cur_rows, "X"] = ((1::colc))`;
dt[cur_rows, "Y"] = (J(1, colc) * (idx))`;
dt[cur_rows, "bin"] = Words(line, "");
);
nw = New Window("test",
H List Box(
align("center"),
Text Box(map_str, <<SET font="" name=""></SET>

Re: Import x and y values from the text file to jmp table and create wafer map@jthi
I want to store the die location and the letters in the jmp data table columns X and Y from the attached text file. How to use JSL to process such txt file as tabular data?

JMP table:

Re: Import x and y values from the text file to jmp table and create wafer mapThanks @jthi
Would you mind sharing the code just so I can refer?
Thanks,
Jack
Re: Import x and y values from the text file to jmp table and create wafer mapI have formatted couple of different kinds of wafermaps with JMP into XY coordinates (and map file) based on text files. Doing it by "manually" scripting I think the process was something like this:
- Parse the text file and get important information (Regex, Words and other character functions are helpful here)
- Row count, Column count
- X size, Y size
- Bin types (especially null/empty type)
- Wafermap
- Any other information (WAFER ID, type...)
- Create new datatable in which you can collect the results into
- Row count is most likely row count * column count
- You need at least X and Y columns, and if you are interested in different bins add column for that also
- Loop over the wafermap string by using Words(wafermap_txt, "\!N") to get each line and build the values by multiplying xsize/ysize depending on which column you are filling.
- This step is much easier if you don't care about the widths and heights and can just use 1 / fixed value
- Also might be a good idea to just code them as coordinates that JMP map files would need, this allows you to build map shape files by using the sizes.
- If you are only interested in the wafermap you could leave out null bins but you have to take it into account when building the map and
Re: Import x and y values from the text file to jmp table and create wafer mapSearch the jmp addin and the past discussions for wafermaps. Lots of answers there