I have a file in textpad:
"ID","Product Code","Supplier Code","Description","SEO Page Title","SEO Meta Description","SEO Meta Keywords","On-Page Name","On-Page Description","On-Page Features","Smart URL"
"1","301897","N/A","Brother DR7000 Drum","Brother DR7000 Drum",,"Brother Drum","Brother DR7000 Drum",,,"301897-brother-drum"
"2","300021","N/A","Post-It Index Arrows 12mm 684-ARR4","Post It Index Arrows 12mm 684 ARR4",,"Post It Index Arrows ","Post-It Index Arrows 12mm 684-ARR4",,,"300021-post-it-index-arrows"
"8558","SMP26","N/A","Shoreline SMP26 Portable Pharmacy Refrigerator","Shoreline SMP26 Portable Pharmacy Refrigerator",,,"Shoreline SMP26 Portable Pharmacy Refrigerator","· 12 Volt DC (fitted with Car cigarette lighter connection for mobile operation) or 220/110 Volt AC (fitted with 3 pin plug for mains power operation)
· 385mmH x 345mmW x 510mm/26 litres Capacity/33 watts
· RPSGB, NHS, WHO, RCVS compliant
· Digital LED Temperature Display/Audio / Visual Temperature Alarm
385mmH x 345mmW x 510mm/26 litres Capacity/33 watts
RPSGB, NHS, WHO, RCVS compliant
Digital LED Temperature Display/Audio / Visual Temperature Alarm
2 Years Parts & Labour Warranty (UK only)
","smp26-shoreline-smp26-portable-pharmacy-refrigerator"
"8559","SMP41","N/A","Shoreline SMP41 Portable Pharmacy Refrigerator","Shoreline SMP41 Portable Pharmacy Refrigerator",,,"Shoreline SMP41 Portable Pharmacy Refrigerator","<p class=""MsoNormalCxSpMiddle"" style=""text-align: right; line-height: normal; margin: 0cm 21.25pt 0pt 0cm; mso-add-space: auto;"" align=""right""><span style=""font-family: Arial; font-size: small;""> </span></p> <p class=""MsoNormalCxSpMiddle"" style=""margin: 0cm 0cm 0pt;""><span style=""font-family: Arial; font-size: small;""> </span></p>","12 Volt DC (fitted with Car cigarette lighter connection for mobile operation) or 220/110 Volt AC (fitted with 3 pin plug for mains power operation)
400mmH x 610mmW x 385mmD/41 litres Capacity
Temperature Range +2°C to +8°C/Forecd air cooling/Digital LED temperature display/Audio Visual temperature alarm
Suitable for Vaccine & Pharmaceutical Storage
RPSGB, NHS, WHO, RCVS compliant
2 Years Parts & Labour Warranty (UK only)
","smp41-shoreline-smp41-portable-pharmacy-refrigerator"
This file has carriage returns and loads of crap data in it. I basically need to do the following before loading into a database. I need to read the file do something with the values in the text file and then output the new file.
If you look above, Lines:
"1","301897","N/A","Brother DR7000 Drum","Brother DR7000 Drum",,"Brother Drum","Brother DR7000 Drum",,,"301897-brother-drum"
"2","300021","N/A","Post-It Index Arrows 12mm 684-ARR4","Post It Index Arrows 12mm 684 ARR4",,"Post It Index Arrows ","Post-It Index Arrows 12mm 684-ARR4",,,"300021-post-it-index-arrows"
are correct.
However line:
"8558","SMP26","N/A","Shoreline SMP26 Portable Pharmacy Refrigerator","Shoreline SMP26 Portable Pharmacy Refrigerator",,,"Shoreline SMP26 Portable Pharmacy Refrigerator","· 12 Volt DC (fitted with Car cigarette lighter connection for mobile operation) or 220/110 Volt AC (fitted with 3 pin plug for mains power operation)
· 385mmH x 345mmW x 510mm/26 litres Capacity/33 watts
· RPSGB, NHS, WHO, RCVS compliant
· Digital LED Temperature Display/Audio / Visual Temperature Alarm
385mmH x 345mmW x 510mm/26 litres Capacity/33 watts
RPSGB, NHS, WHO, RCVS compliant
Digital LED Temperature Display/Audio / Visual Temperature Alarm
2 Years Parts & Labour Warranty (UK only)
","smp26-shoreline-smp26-portable-pharmacy-refrigerator"
which is broken,
I need to write a bit of code that says when you see a "(a number) then create a new line in the file, else append to the previous line.
I need to create a webform app or console app it doesn't matter.