Advertisement

04.13.2005 at 03:25PM PDT, ID: 21387971
[x]
Attachment Details

Delete a line in a text file using c program/perl script + system call

Asked by sanjay_thakur in Perl Programming Language

Tags: file, text, line, c, delete

Hi,
I need to execute a perl script from a c program. so I presume I have to use System call. I need to pass 2 arguments to the perl script.
Arg1: filename
Arg2: string

The script should search & delete  the line with the matching string.
It should return appropriate retVal back to the System code so that
the c program can check against it.

A functioning code snippet will be helpful since I am not much
fimiliar with perl.

Also is there any way to do this in C without creating a new file.

Thanks in advance for help and feedback.Start Free Trial
 
Loading Advertisement...
 
[+][-]04.13.2005 at 04:10PM PDT, ID: 13777567

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.13.2005 at 04:14PM PDT, ID: 13777590

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.13.2005 at 04:16PM PDT, ID: 13777600

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.13.2005 at 05:48PM PDT, ID: 13778061

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.13.2005 at 06:02PM PDT, ID: 13778100

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.13.2005 at 06:30PM PDT, ID: 13778233

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.13.2005 at 06:40PM PDT, ID: 13778279

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Perl Programming Language
Tags: file, text, line, c, delete
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]04.13.2005 at 08:24PM PDT, ID: 13778651

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32