cristi
cristi

Reputation: 13

Find and Replace string in notepad++

I have a CSV file containing three columns:

10.630892, 43.653193,This is a GPS position 
10.630893, 43.653194,This is a GPS position of a restaurant 
10.630895, 43.653195,This is a GPS position of a very nice restaurant 

I would like to have the following result :

10.630892, 43.653193,Restaurant
10.630893, 43.653194,Restaurant
10.630895, 43.653195,Restaurant

In other words , whatever is after the second coma(till the end of the line) , to be replaced with a given word , for example : Restaurant

I tried to identify the string ",This is" followed by no matter how many characters and replace with ",Restaurant" , but still unsuccessful ...

Upvotes: 1

Views: 606

Answers (3)

Denham Coote
Denham Coote

Reputation: 674

Hit Ctrl + H to open the Replace Dialog.

Under search mode, select Regular Expression.

  • Find what: ,T.*
  • Replace with: ,Restaurant
  • Click on Replace all

Upvotes: 0

Richard Schwartz
Richard Schwartz

Reputation: 14628

Instead of doing this with Notepad++, I would just open up the CSV file in Excel*, replace the third column all the way down, and save as CSV again.

* Or any other spreadsheet program that can read and save CSVs.

Upvotes: 1

Guillaume Jacquenot
Guillaume Jacquenot

Reputation: 11717

You should tick the regular expression box, and try to search ,This is.*$ and replace it with ,Restaurant.

Upvotes: 1

Related Questions