Hi 
I am writing a perl scipt in that I want to change the dir to some other and run a exe 
from there is it possible?
Because chdir is not working there.
Thanks and Regards
-Gayatri
  ----- Original Message ----- 
  From: Sparrow, Dave 
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, June 24, 2003 3:46 PM
  Subject: Parsing .csv file


  I'm reading an Excel .csv file.
  Fields are separated by commas.
  If a field contains a comma, the whole field is double-quoted (Excel does
  this by default).
  An example of an input line is as follows:

  field1,field2,"field3a, field3b, field3c",field4,"field5a, field5c",field6

  I want to get each field into an array.
  Quoted fields should be in one element, containing commas, but without
  quotes.

  Code so far is shown below. 
  It's a bit messy.
  Anyone have a better way?
  Thanks in advance,
  Dave

  # Note: $_ contains the whole (chomped) line at this point
  while (m/,"(.*?)",/) {
    $a = $`;
    $b = $';
    ($m = $1) =~ s/,/¬/g;  # Just use some temporary character other than a
  comma
    $_ = $a.",".$m.",".$b;
  }
  @arr = split(",");
  foreach (@arr) {s/¬/,/g;}
  # Done



  -- 
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]



********************************DISCLAIMER**********************************

This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege of Deccanet Designs Ltd.
If you have received this message in error, please notify the originator
immediately. If you are not the intended recipient, you are notified that
you are strictly prohibited from retaining, using, copying, altering or
disclosing the contents of this message.

****************************************************************************

Reply via email to