I'm currently using $readini() with a data file that might have more than one match. Instead of manually going through the entire data file to append the data so the matches are on one line I'd like to find a way to just accumulate the data when the result is shown. Is there a way to do that?

What I'm doing is using $readini() to retrieve a zip code data match and show it on the channel my bot is on. I already have a feature that matches the zip code a user gives and it retrieves the city and state from the data file and displays it. This feature runs fine.

What I'd like to do is do the reverse and have the user enter the city and state and the bot retrieves all the valid zip codes that are related to that specific city and state. Being there's sometimes more than one zip code attached to the city and state there's a couple or more lines. So, I need to have the bot give the extra matches. $readini() only retrieves a single match as does most of the other commands like that.

Is there a way to do read more than one match and append it into a single result without going crazy with lots of code?

I'm still learning coding and I haven't found an easy way to accomplish what I need.

By the way, the reason I don't want to just go through the data and append the zip codes into a single line is because my data file is about 42,000 lines. The process of altering the data would take an excessively long time. That's why I'm looking for a more time effective solution.

I'd deeply appreciate any help anyone could give me.



Lloyd