I have a text file (actually many of them) that among other things has lines of text like the following:
AVCA Advocat Q4 2009 Advocat Earnings Release $ 0.14 n/a $ 0.21 9-Mar AMC
or
ACAD ACADIA PHARMACEUTICALS INC Q4 2009 ACADIA PHARMACEUTICALS INC Earnings Release -$ 0.19 n/a -$ 0.38 9-Mar AMC
The lines begin with a tab (or maybe it's just 4 spaces) There is a tab between the stock symbol and the company name, but all other fields are separated by 2 spaces.
What I need is the stock symbol, company name, estimate, actual, previous, and date in csv Using the above examples, what I'm looking for is:
AVCA,Advocat,0.14,n/a,0.21,9-Mar AMC
ACAD,ACADIA PHARMACEUTICALS INC,-0.19,n/a,-0.38,9-Mar AMC
I think awk is the right tool for the job (the awk command will make it into a bash script to do this everyday)
AVCA Advocat Q4 2009 Advocat Earnings Release $ 0.14 n/a $ 0.21 9-Mar AMC
or
ACAD ACADIA PHARMACEUTICALS INC Q4 2009 ACADIA PHARMACEUTICALS INC Earnings Release -$ 0.19 n/a -$ 0.38 9-Mar AMC
The lines begin with a tab (or maybe it's just 4 spaces) There is a tab between the stock symbol and the company name, but all other fields are separated by 2 spaces.
What I need is the stock symbol, company name, estimate, actual, previous, and date in csv Using the above examples, what I'm looking for is:
AVCA,Advocat,0.14,n/a,0.21,9-Mar AMC
ACAD,ACADIA PHARMACEUTICALS INC,-0.19,n/a,-0.38,9-Mar AMC
I think awk is the right tool for the job (the awk command will make it into a bash script to do this everyday)