Reading from second column of excel inside a for loop in Katalon studio - katalon-studio

I have a for loop which reads data from a particular column "A" of an excel sheet.
Now, for this for loop in the first iteration I need to read specific rows like row 1 and row 3 from another column "B" of excel.
Then in the second iteration I want to read row 2 and row 4 of the same column "B", and then in the third iteration I want to read row 5 and row 7 from the same column "B".
How can I achieve this, my main for loop is working fine, but somehow I am unable to read specific rows.

I found the instruction at https://www.katalon.com/videos/get-datas-excel-file-katalon-studio/. Hope that it help

Related

Tableau collate data from multiple columns

I am not sure what the technical term for what I am trying to do is.
Hoping raw data and output below will clearly define the use case.
Raw data :
This is what my raw data looks like
Output 1 :
this is what I am trying extract first
Here I am trying to get a table where the first column has the name of the guests and 2nd column has the count of times they have featured in the table as a guest.
Output 2 :
this what I am trying extract next
Here I am trying to map months against names and see how many nights one has collected in which month.
One way to achieve this would be to create a temp table with 5 columns,column 1 with Guest names,
column 2 with count of occurrence in guest 1 column in raw data table,
column 3 with count of occurrence in guest 2 column in raw data table,
column 4 with count of occurrence in guest 3 column in raw data table,
column 5 with total of previous 3 columns.
But I am trying to find a proper solution through tableau, if possible. Because this way would not help me achieve Output 2.
Plain text raw data if you'd like to work on it :
booking by,Guest 1,Guest 2,Guest 3,stay start,stay end,hotel code
Ram,Seema,Ram,,May 1 2018,May 2 2018,BBST
Karan,Ram,Seema,,May 6 2018,May 7 2018,BRRLY
Mahesh,Mahesh,Seema,Ram,June 2 2018,June 4 2018,BBST
Krishna,Krishna,,,June 2 2018,June 3 2018,BRRLY
Seema,Seema,,,June 7 2018,June 8 2018,BRRLY

How to check if the stream of rows has ended

Is there a way for me to know if the stream of rows has ended? That is, if the job is on the last row?
What im trying to do is for every 10 rows do something, my problem are the last rows, for example in 115 rows, the last 5 wont happen but i need them to.
There is no built-in functionality in Talend which tells you if you're on the last row. You can work around this using one of the following:
Get the row count beforehand. For instance, if you have a file, you
can use tFileRowCount to count the number of rows, then when you
process your file, you use a variable for your current row
number, and so you can tell if you've reached the last row. If your
data come from a database, you could either issue a query that
returns the total number of rows beforehand, or modify your main
query to return the total number of rows in an additional column and
use that (using ranking functions).
Do some processing after the subjob has ended: There may be situations
where you need a special processing for the last row, you can achieve
this by getting the last row processed by the previous subjob (which
you have already saved, for instance, by putting a tSetGlobalVar
after your target, when your subjob is done, your variable contains the last written value).
Edit
For your use case, what you could do is first store the result of the API call in memory using tHashOutput, then read it with a tHashInput in order to process it, and you'll know then how many rows you have retrieved using tHashOutput's global variable tHashOuput_X_NB_LINE.

How do I force tJavaFlex to generate multiple rows for a single row

How do I make tJavaFlex generate multiple output rows for a single input row? I don't want to use tSplitRow as I have to do other processing.
But for example, if I add a for loop inside my main code, and split my string into words the below happens, and I just get the last word in the sentence in my output flow:
tRowGenerator generating one sentence (1 row, one column):
tJavaFlex with loop in the Main section splitting the sentence into word tokens:
And this is what I get:
I had thought my loop would generate 10 rows in the output. Is there a way to make the tJavaFlex do this kind of multiplication of input rows?
In order to achieve your requirement, you need to use component tnormalize.
Below is just a sample job using tNormalize component and I have used the same string that you have used
I have provided item separator as "space"
I have got the below result for simple println statement
Hope this may help you out.

Update columns in UItable with timer in Matlab

I have a UItable with the 4 first columns that are being updated every 1 second with some external logger data. I would like to have a 5 column with a logical select column, so I could select which instruments to display.
The problem is the timer update the 'data' of the UItable, and I can't find a way to only update the first 4 columns without updating the last (5th) one.
Does anyone would have a solution ?
Thanks for your help.

Check if a special row in a cell array exists in MATLAB or not

Please i need help but it's a little hard for me to declare it correctly in English,please be patient with me.
I've got a cell array which for example has 10 rows and 10 columns.
I fill each rows of the cell array in a loop(for) and there is this Probability that a row of it wont get any value then the result is e.g there would be rows 2 and 4 but there would n't be any third row:
t{2,1},...,t{2,10} exits
t{4,1},...,t{4,10} exists
but there is no t{3,1},.....,t{3,10}
Now i want to check if the third row exists or not?
I tried:
if t{3,1}
but it did not worked and there is not any codes like:
if exists(t{3,1})
what should i do?
t{3,1} does exist, it's just empty. Therefore what you need is something along the lines of:
if ~isempty(t{3,1})