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

3

1 Answer 1

0

Got it.

I did this

php test.php input.csv

and used the input as an argument

$args = $argv[1];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.