Get Line from file, search & place in table

emperorjones

Новичок
Регистрация
18.09.2014
Сообщения
27
Благодарностей
1
Баллы
3
Not sure if zenno can do this...

I want to take a line from a list of emails I have and then have zenno search a table for the matching domains and if there is a match, add the email to a cell in the table.

So for example, the list reads:

1. [email protected]
2. [email protected]
3. [email protected]

and the table has a row with three columns that contains this data:

1. DoctorName; Address; http://www.mydoctor.com; [blank cell]

I'd like to take a line from the list and check each row from the table and see if it matches the domain in column 3 (www.mydoctor.com), if it does, I'd like to write it into row 1, cell 4.

Is this possible?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 770
Благодарностей
1 181
Баллы
113
Not sure if zenno can do this...

I want to take a line from a list of emails I have and then have zenno search a table for the matching domains and if there is a match, add the email to a cell in the table.

So for example, the list reads:

1. [email protected]
2. [email protected]
3. [email protected]

and the table has a row with three columns that contains this data:

1. DoctorName; Address; http://www.mydoctor.com; [blank cell]

I'd like to take a line from the list and check each row from the table and see if it matches the domain in column 3 (www.mydoctor.com), if it does, I'd like to write it into row 1, cell 4.

Is this possible?

Hi. Sure it is possible, and if honestly I do not have anything other to suggest as making it by plan You have already told.
Check list and table processing in wiki if you do not know anything about it and go ahead :-) You can post some screenshots of what You have done if something is not working :-)
https://zennolab.com/wiki/en:list
https://zennolab.com/wiki/en:table

Thanks
 

emperorjones

Новичок
Регистрация
18.09.2014
Сообщения
27
Благодарностей
1
Баллы
3
Thanks lokiys. I guess i can do this lol. I already have a file that searches a list for specific text. I search the forum and found code for searching a table for specific text and fount this:

We need to check if there is a cell that contains a specific text.
It can be solved using this C# macro (in the attached project, we are searching a cell that contains "Mexico")
Code (javascript):

  1. // take text for search from a variable
  2. var textContains = project.Variables["tableSearchTextContains"].Value;
  3. // get table for search
  4. var sourceTable = project.Tables["SourceTable"];
  5. // search in each row
  6. lock(SyncObjects.TableSyncer)
  7. {
  8. for(int i=0; i < sourceTable.RowCount; i++)
  9. {
  10. // read a row (array of cells)
  11. var cells = sourceTable.GetRow(i).ToArray();
  12. // loop through all cells
  13. for (int j=0; j < cells.Length; j++)
  14. {
  15. // check if cell contains specified text, if there are matches return "yes"
  16. if (cells[j].Contains(textContains))
  17. return "yes";
  18. }
  19. }
  20. }
  21. // if nothing found return "no"
  22. return "no";

How would I change this so that if "yes" it writes/appends the variable in the appropriate cell?
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)