-1

I have a file that has lines like:

string1,string2,string3

I would like it to just be

string2

How would I use regular expression to do this?

2
  • Meaning, you want just column 2 in a CSV file, or is it specifically targeting string1, and ,string3?
    – slhck
    Jun 29, 2014 at 10:11
  • I just want column 2 in a CSV file.
    – Devin
    Jun 29, 2014 at 10:25

1 Answer 1

0

Assuming you have strictly 3 columns, and strings do not contain comas ( , ) and are separated by comas ( , ), then:

find:

(.+),(.+),(.+)

replace

\2

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .