PS Query & SQL

 View Only

Convert column of values to single-quote-comma-separated row with Notepad++ 

01-22-2025 10:59 AM

Steph Zimmerman submitted this technique 

Use this to convert a column of values into a single row of values separated by apostrophes and commas.

  1. Open Notepad ++ 
  2. Copy and paste column of data into Notepad ++
  3. Search > Replace
    1. Find What: (\h*\R)+
    2. Replace with: ','  
    3. Search Mode > Regular expression
  4. Add left parentheses and single quote at beginning of string and single quote and right parentheses at end of string

In the criteria for the query, set the condition type "equal to" expression then copy and paste this into an ANY phrase, like this:


#column_to_rows
#PSQuery
#Steph_Zimmerman

Attachment(s)
png file
Screenshot 2025-01-22 095701.png   27 KB   1 version
Uploaded - 01-22-2025

Related Entries and Links

No Related Resource entered.