Yes we can create flatfile schema based on the input file.
Please refer to documentation for more details.
If input file doesn’t have fixed column per line, you should create number of possible fields in the schema.
And all the fields should be set mandatory to false.