cancel
Showing results for 
Search instead for 
Did you mean: 

appending values horizontally to a list

SOLVED
Highlighted
Occasional Contributor

appending values horizontally to a list

is there is a way to horizontally add items to a list.Normally it is added vertically.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Occasional Contributor

Re: appending values horizontally to a list

@TanyaGorbunova 

It was just a for loop.My requirement was to take out 4 values each from a list of 600+ values horizontally.I think I messed up  the question I asked here.Please find the code below.

for m in range(0, (len(valueList)-1), 4):
regexpattern=(".*")+re.escape(valueList[m])+(".*")+(valueList[m+1])+(".*")+re.escape(valueList[m+2])+(".*")+re.escape(valueList[m+3])+(".*")

 

 

View solution in original post

6 REPLIES 6
Highlighted
Community Hero

Re: appending values horizontally to a list

I'm not sure I understand the question.  What kind of list? What do you mean "horizontally" versus "vertically"? 


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: appending values horizontally to a list

Dear Robert,

I have created a set of values from a json file in a list which have around 700+ values.I wanted to rearrrange it to columns of 4.Could you please guide me for the same.

Thank you.

 

Highlighted
Community Hero

Re: appending values horizontally to a list

Are you inputting these values into columns in some table or something? Because, in "abstract" code, there really isn't much the idea of rows and columns.  Of course, I could be missing something here but I'm still not sure I understand your goal.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: appending values horizontally to a list

My problem is resolved.Thanks for the reply.

Highlighted
Community Manager

Re: appending values horizontally to a list

Great to hear this, @manuelaneena,

 

Please share your solution with us.

---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Occasional Contributor

Re: appending values horizontally to a list

@TanyaGorbunova 

It was just a for loop.My requirement was to take out 4 values each from a list of 600+ values horizontally.I think I messed up  the question I asked here.Please find the code below.

for m in range(0, (len(valueList)-1), 4):
regexpattern=(".*")+re.escape(valueList[m])+(".*")+(valueList[m+1])+(".*")+re.escape(valueList[m+2])+(".*")+re.escape(valueList[m+3])+(".*")

 

 

View solution in original post

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!
Top Kudoed Authors