I have a txt file with thousands of domain names (200k+, 3MB) and need to do a filter on it.
I could use SET + IF + List Nodes, but the process is really heavy, so I would like to make it all in a single Code Node.
As I’m not really familiar with the new process, would love to get your help.
Sample results I get from a HTTP call to a TXT file:
# file instructions
# find below the domains
cnn.com
bbc.co.uk
fox.com
99bugs.org
# end of list
- I need to .split the line breaks into array, so every domain will be a new item
- Filter only the lines not starting with # (keeping only the domain names)
- Get the final result with a clean domains list
I’m sure this should be a simple code but I can’t find many examples on how to use the new Code Function.
Thanks a lot!