We help IT Professionals succeed at work.
Get Started

Scripting Perl

Navarre_EDI
Navarre_EDI asked
on
237 Views
Last Modified: 2012-05-12
Hello

I would like to search within a file for CRLF not SUM how do I change my script

#!/usr/bin/perl5
 

 my $file=$ARGV[0];
 my $run;
 print "Begin the program: \n";
 open (DATA,"$file") or die "can not open the inputfile\n";
 while(<DATA>){
   open (FILE,">>d:/inbound/groupontemp.txt") or die "can not create a new file in this directory\n";
   print FILE $_;
   if ($_=~/^SUM/){close (FILE);
 
   $run="d:/tiecom~1/eVision/bin/putmail.exe -m Outbound_WA_Zerochroma_Post -f d:/inbound/groupontemp.txt";
   open (RUN,"$run |") or "can not pipe";
    while (<RUN>){print $_;}
   close (RUN);
   unlink ('d:/inbound/zerochromatemp.txt');
  }
}
close (DATA);
Copy-of-mike.csv
Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 3 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE