I have tried a dozen different ways and cannot get it right.
I have many text files in different folders, so I would like to reference the input file as a variable eg: *.txt (just use whatever txt file is in the same folder as the bat file).
I need to copy the first 6 lines and paste them into a new txt file.
I would like to name it (but not essential) SAMPLE_original_txt_file_name
EG:
Input = text01.txt
Output = SAMPLE_text01.txt (this would contain the first 6 complete lines from text01.txt)
I would appreciate any help as my head now needs stitches from banging it too much against a wall...
The following worked for me:
The above script expects an argument, which is a file mask, like
*.txt
. It also supports masks completed with (existing) paths. Whether the path is specified or not, the output sample files are created in the same directory as the original ones.