Hi,
Reading each line in text file and import each string as a separate row in the jmp data table
I 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("Courier New")), dt << Graph Builder( Size(529, 457), Show Control Panel(0), Variables(X(:X), Y(:Y), Color(:bin)), Elements(Points(X, Y, Legend(9))), SendToReport( Dispatch( {}, "X", ScaleBox, {Min(0.461038514127673), Max(13.543406057392), Inc(1), Minor Ticks(0), Label Row(Show Major Grid(1))} ), Dispatch( {}, "Y", ScaleBox, {Min(14), Max(0), Inc(1), Minor Ticks(0), Label Row(Show Major Grid(1))} ), Dispatch( {}, "400", ScaleBox, {Legend Model( 9, Properties(0, {Marker Size(20)}, Item ID(".", 1)), Properties(1, {Marker Size(20)}, Item ID("B", 1)), Properties(2, {Marker Size(20)}, Item ID("G", 1)) )} ) ) ), dt << Graph Builder( Size(529, 457), Show Control Panel(0), Variables(X(:X), Y(:Y), Color(:bin)), Elements(Heatmap(X, Y, Legend(10), Label("Label by Value"))), SendToReport( Dispatch({}, "X", ScaleBox, {Min(0.461038514127673), Max(14.3842387539345), Inc(1), Minor Ticks(0), Label Row(Show Major Grid(1))}), Dispatch({}, "Y", ScaleBox, {Min(14.3060372430966), Max(0.789075991529451), Inc(1), Minor Ticks(0), Label Row(Show Major Grid(1))}) ) ) ) );
Using 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);
Search the jmp addin and the past discussions for wafermaps. Lots of answers there
I 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:
Thanks @jthi Would you mind sharing the code just so I can refer?
Thanks,
Jack
@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:
It 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?
Hope 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!