ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

Separate Out STOCK Symbols From Large Text File

(1/4) > >>

nkormanik:
Assume:  Stock symbols are composed of CAPITAL LETTERS.

What might be an efficient way of extracting out all stock symbols from a large text file, with stock symbols appearing here and there throughout?

Thanks much!

Nicholas Kormanik

skwire:
Can you provide us with the text file?  Or a sample thereof?

nkormanik:
Here is an example of part of such a text file.  I am not expecting perfection, mind you.  Some further editing will likely be required.  Again, let's assume that NOTHING other than caps will be allowed, so excluding parentheses, colons, commas, numbers, etc.:


--- ---(FWONA), Facebook (FB), Universal Display (OLED), Apple (AAPL), SBA Communications (SBAC), and Abiomed (ABMD

The daily volume for an average stock on the S&P 500 is 4 million shares, while the median is slightly more than 2 million. Bank of America Corp’s BAC, -0.29% average daily volume is about 87 million shares, followed by Apple Inc’s AAPL, +0.37% at roughly 54 million. By comparison less than 300,000 shares of Dun & Bradstreet Corp. DNB, +0.28%  changed hands in the average day.
Other standouts include energy, airline and biotechnology stocks - small and large. Since the start of the year, on average, about 20 million shares of Chesapeake Energy CHK, -1.81% changed hands daily, (The stock lost more than half its value since the start of the year.) Halliburton Co. HAL, +0.57% Exxon Mobil XOM, +0.51% Transocean Ltd. RIG, +3.51% Delta Air Lines DAL, +3.25% American Airlines Group AAL, +5.43% General Motors GM, +0.23% and Ford Motors F, +1.03% saw people churn their stocks.

Symbol Company Last Sale* Change Net / % Share Volume
AAPL
Apple Inc. Apple Inc. $ 159.86 0.59 ? 0.37% 24,783,937
QQQ
PowerShares QQQ Trust, Series 1 $ 141.97 0.30 ? 0.21% 24,236,348
TVIX
VelocityShares Daily 2x VIX Short-Term ETN $ 16.90 1 ? 5.59% 22,703,370
CSCO
Cisco Systems, Inc. Cisco Systems, Inc. $ 31.44 0.20 ? 0.64% 18,206,334
JD
JD.com, Inc. JD.com, Inc. $ 40.87 1.20 ? 2.85% 15,610,100
MOMO
Momo Inc. $ 35.59 2.39 ? 6.29% 15,112,039
BRCD


nkormanik:
If someone here wants to actually create a program to do the above, perhaps it might be called:  Stock Symbols Only.

(Skwire's Stock Symbols Only??)

I think what I am asking for can be accomplished with RegEx, but not sure.

A little Windows program, even a command-line program, asking for the text file input, and spitting out results to a separate file would be perfect.  Prefer symbols to be one per line, but not necessary, and no need to sort.

skwire:
So, from that example, you just want a list like this?:


--- ---FWONA
FB
OLED
AAPL
SBAC
ABMD
BAC
DNB
CHK
HAL
XOM
RIG
DAL
AAL
GM
F
QQQ
TVIX
ETN
CSCO
JD
MOMO
BRCD

Navigation

[0] Message Index

[#] Next page

Go to full version