1

I want to open an excel and then manipulate the content using php and command line/cmd or powershell.

I have this script already

$data = file("input.csv");
foreach ($data as $line) {
    $lineArray = explode(",", $line);
    list($XXX, $XXX, $XXX, $XXX, $XXX, $XXX) = $lineArray;

    echo $XXX.",".$XXX.",".$XXX.",".$XXX.",".$XXX.",".$XXX;
    echo "\n";
}

I'm just running it in power shell using this

php test.php 

What I'm targeting to do is like this

php test.php input.csv

and I will remove the statically coded input.csv

TheOneNewbie
  • 81
  • 1
  • 7

1 Answers1

0

Got it.

I did this

php test.php input.csv

and used the input as an argument

$args = $argv[1];
TheOneNewbie
  • 81
  • 1
  • 7