Anonemous
Anonemous

Reputation: 3

Transpose row data to columns by charcter in notepad++

Is there a way to transpose data in notepad++ by delimiter?

For example, I have many entries of:

John Doe
$100
$200
$300
$400
$500
Jane Doe
$1
$2
$3
$4

I'm trying to get the output so I can paste to spreadsheet by columns as:

John Doe  $100 $200 $300 $400 $500
Jane Doe  $1   $2   $3   $4   $5

Upvotes: 0

Views: 935

Answers (2)

Julio
Julio

Reputation: 5308

For notepad++ you could use this Regex:

Search: \v+(?=\h*[$\v])

Replace by: \t

The data will be separated with tabs so you should be able to copy-paste it to Excel.

Also, this should work with different number of entries for every name.

You have a demo of the regular expression here

NOTE: I'm assuming that the data for every person starts with $

Upvotes: 2

Michael
Michael

Reputation: 4838

It's far easier to just put your raw data straight into Excel and arrange it there using a formula:

If you put your raw data into column H, starting from H1, then you can put this formula into A1, fill across to F1, then fill down as far as needed:

=INDEX($H$1:$H$24,(ROW()-1)*6+COLUMN())

enter image description here

Upvotes: 0

Related Questions