No, this is not possible. The EVM has no access to a filesystem.
import keyword is used at contract compile time, in your local build environment. It imports Solidity code ahead of creating the smart contract. It does not form part of the compiled contract and is not executed on the blockchain (in the EVM).
Once the contract has been deployed, it runs only in the Ethereum Virtual Machine (EVM) and can neither read nor write files.
Instead, contracts have two ways to record output.
For ephemeral results that the contract does not need to store, you can issue Events to log limited amounts of data. These logs can be queried later using blockchain explorers or other tools.
Contract state that needs to be maintained can be placed in contract Storage and queried later (using getter functions, which Solidity can automatically generate for you). This is relatively more expensive in gas terms than events.
Remember that the contract after deployment will be run on thousands of nodes worldwide. It currently doesn't make much sense to think of a conventional filesystem in these terms. Perhaps in future there may be a way for the EVM to interact with Swarm (a fully distributed filesystem). But that would be a long way off from now.