Importing lines from a text file if they start with 123-abcd in powershell array
Posted on 2014-12-11
Im trying to import lines from a text file into an array.
The only I know for sure that is that all lines always start with a combination of 3 numbers and 4 letters:
350-11079 Chassis with up to 10 Hard Drives and 3 PCIe Slots, Low Profile PCI Cards Only 2 SR
350-10048 No Bezel Option - Rack Chassis 2 SR
370-AAGI 16GB RDIMM, 1600MHz, Low Volt, Dual Rank, x4 16 SR
370-22141 1600 MHz RDIMMs 2 SR
370-22145 Performance Optimized 2 SR
374-14451 Heat Sink for PowerEdge R620 4 SR
374-14454 DIMM Blanks for Systems with 2 Processors 2 SR
How can I get all those lines into an array or directly in a csv
The text source is an PDF to text converted dell invoice so there is a lot of extra text which I don't need...