1

I want to replace in the 3rd column ONLY the pattern 'foo' by 'bar' of the following CSV file. Is it possible to do this with emacs or do I need to write a script to do this ?

foo;bbb;foo;
foo;bbbbbbbb;bar;
foo;bbbbbb;foo;
foo;bbbbbbbbbbbb;bar;
foo;bbbbbb;foo;

So, the expedted result would be :

foo;bbb;bar;
foo;bbbbbbbb;bar;
foo;bbbbbb;bar;
foo;bbbbbbbbbbbb;bar;
foo;bbbbbb;bar;

1 Answer 1

3

With csv mode: https://github.com/emacsmirror/csv-mode

M-x csv-transpose
Then your column is a line, so you can select as region and do a query-replace on the region or use narrow-to-region or ...
M-x csv-transpose
    -
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.