Hello Everyone,
Here is a script I have that works. I want to know if there is a better way to do the same thing.
I first use "load text file" to read a text file into the string variable "file_text1".
Next, I use "words" with "\!n" to separate the lines and load them into the string array "file_text2".
Next, I then load the "file_text2" into a data table. I then use the "get rows where" combined with "contains" to find the line number in the original text file that contains a certain string.
Is there a function equivalent to "get rows where" but usable for string arrays? This way, I can skip the portion to load into data table.
file_text1 = load text file( "example.txt" );
file_text2 = words(file_text1 , "\!n");
dt0 = new table("file_dt", new column("file_content", character) );
dt0:file_content << set values(file_text2);
pass_qty_row_array = dt0 << get rows where(contains( :file_dt, "Pass") );
pass_qty_row = pass_qty_row_array[1] + 1;