2

How to replace column of values with another column of values in notepad++ For example , Let's say I have file 1 contents as below

name2.address2.age.location
name3.address5.age.location
name1.address1.age.location
name4.address4.age.location

and I want to replace address column with the new values from another file

A123
234
5678
adafsffsafasfa

so that my replaced contents look like this

name2.A123.age.location
name3.234.age.location
name1.5678.age.location
name4.adafsffsafasfa.age.location

I tried Alt+c and alt+shift combination, but that didn't help. Thanks for your time.

Forever Learner
  • 1,465
  • 4
  • 15
  • 30
  • Maybe write a small program which uses `regex` to do the same? – CinCout May 31 '16 at 05:35
  • 1
    See here: http://stackoverflow.com/questions/19321916/notepad-how-do-i-insert-a-column-of-data – Ton Plooij May 31 '16 at 05:37
  • Cinout, regex wich comes to my mind will work on single value. Ton Plooij, that solution is pasting the single value in single column. While I want to replace single column with multiple values. – Forever Learner May 31 '16 at 05:41
  • Why not show us what you've tried, so that it can be improved? – CinCout May 31 '16 at 06:15
  • CinCout, I tried the linux way "awk -F. 'NR==FNR{a[NR]=$0;next}{$2=a[FNR]}1' "... but I want windows solution. In notepad++ I selected the couln using "Alt+Shift+Down" key and replaced it with ABC using "Alt+C" combination. – Forever Learner May 31 '16 at 06:31

1 Answers1

6

I was playing around and I accidentally discovered the solution to my problem. To replace a column follow the steps below:

1. Select the column using "`Shift + Alt + Down`" key combination 
2. Then delete the column by pressing the "`Delete`" key.
3. Select "new" column using "`Shift + Alt + Down`" key combination
4. Do the `drag` while holding down the `Alt` key. 

Attached is the animation for better clarity. enter image description here Alt drag can be used for even shifting the column positions as well

Forever Learner
  • 1,465
  • 4
  • 15
  • 30