I have multiple .txt files in the form of
Name1|number1
Name2|number2
Name3|number3
(...)
And I would need to transpose them to look like:
Name1|Name2|Name3|(...)
Number1|Number2|Number3|(...)
This is easy enough to do for a single file in excel, but I would need a way to do this in multiple files in a folder. Since Notepad++ allows finding and replacing for multiple files, I would like to know if there is a way to achieve this somewhat automatically.
While all files have the same pattern (two columns), not all of them have the same number of rows.
I have tried the following aproaches using Notepad++:
- Replacing
|
for a carriage return to have everything in a single column, in hopes to somehow group all numbers, move them to the bottom and reorganize. - Repeat the whole text below using a symbol to separate both copies (find
[\s\S]*.*
, replace with\0\n%\n\0
), in an attempt to delete all numbers above and all names| below to finally reorganize. Also got stuck in the middle.
As you can see, my Regex knowledge is extremely limted, even using Regex101. I don't know if this is easy or hard to achieve, I simply cannot find the solution by myself after several hours.
What can I do?
Thanks for your patience in advance.