I'm working with a list, which is about 5 mil lines in this format
Sample:
Information about Ticker is listed between the two "----------". Now I want to extract some lines, and copy them to the next document, but remain the format. If there are any missing information, then return N/A.
Say I need to extract Ticker, Company name, Current Price, Book Value, RSI, then the final result would look like this:
Result
What is the best solution to deal with this case ? Thanks in advance
Sample:
Code: Select all
----------
1.Ticker: AAA
2.Company name: abcde
3.Current Price: 12345
4.EPS: 23456
5.P/E: 45678
6.Adjusted P/E: 23124
7.Book Value: 56789
8.ROA: 67890
9.ROE: 78901
10.RSI: 89.12
11.MA50: 80.890
12.MA100: 89.879
----------
1.Ticker: CCC
2.Company name: adsad bcde corp.
3.Current Price: 1234563
4.EPS:
5.P/E: 458
6.Adjusted P/E: 89852
8.ROA:
9.ROE: 896785
11.MA50: 87764
12.MA100: 12386
----------
....so on
Say I need to extract Ticker, Company name, Current Price, Book Value, RSI, then the final result would look like this:
Result
Code: Select all
----------
1.Ticker: AAA
2.Company name: abcde
3.Current Price: 12345
7.Book Value: 56789
10.RSI: 89.12
----------
1.Ticker: CCC
2.Company name: adsad bcde corp.
3.Current Price: 1234563
N/A
N/A
----------
....so on