I am trying to write a bash script to generate a csv file from text within multiple pdf documents. I have a script for converting pdf to text, but not for generating the csv file. Each text document gets its own row, with certain pieces of data extracted from each text document. The first row of the csv file contains the name of the column, while everything else is data extracted from the text file. So you would have the csv file looking something like this:
Not all text inside the text files will be used, just lines that fit certain patterns (dates, codes, contents of certain sections). There will be more than 3 lines also. How would I go about creating the csv file like this? Would I redirect standard output to a file, the file being the csv file, and then how do I then format it as a csv file that way?