Complex Search and Replace

G

Glo Worm

Hello,

How can I take a file such as

abc'abc
abc\'abc
abc\\\'abc

and use a Perl script to make it look like

abc\'abc
abc\'abc
abc\'abc


?

In any case I'd like for the first and second field to be delimited with
\'

Thank you.
 
J

Jürgen Exner

Glo said:
Hello,

How can I take a file such as

abc'abc
abc\'abc
abc\\\'abc

and use a Perl script to make it look like

abc\'abc
abc\'abc
abc\'abc

In any case I'd like for the first and second field to be delimited
with \'

You don't give much details about what 'abc' can be nor about what the
erronious possible delimeters can be in the original file (just listing
three examples is a bit meager).

What about a plain
s/\\*/\\/
This does the job at least for your examples.

jue
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top