Yes I tried your code and it did write out a single line.
I do need to drop the beginning part of the url https://www.abc.com
also would I write it out to a .csv file?
I need to take the one line and enter into another program.
I appreciate your help.
Thanks for your help and your last note to format sample data and console output in code format.
I don’t work with Powershell too often. I appreciate your help and the Powershell community.
I have 56 separate .csv files that contain department URLS. The intent of this script is to eliminate me from enter the urls separately into a Google Analytics report for report filtering. The filtering text box wants a string of urls separated by the “|” character. So with your solution I can create 56 outputs that I can copy and paste into the filter’s text box… There is no API interface to feed them automatically into GA.
I want to add onto your solution to have the script go to the folder where I have 56 separate .csv files are located, loop through each .csv file and automatically create 56 separate output files with their one url string. This would save time from running your solution 56 times. The output file name would be the .csv’s filename… example OutputPlanningURLS.txt (the output format can be a .txt)