i need your kind help.
i need to format below lines into CSV format, file size in MB ~4MB.
--------------
*** ALARM
ENABLED
(41431) 7409 EXTERNAL AL 9
COMMERCIAL POWER FAILURE
... CANCEL
ENABLED
(41431) 7409 EXTERNAL AL 9
COMMERCIAL POWER FAILURE
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Wim SturkenboomRank #2,527 · 554 reputationPosted Jan 4, 2015, 11:59 PM EST
Anyway, it looks like fixed-width fields and you can use the TextFieldParser class to parse the fixed width lines.
Next you can write the resulting fields to file using one of the many csv code samples on the web; my favorite is the one by Andreas Knab (write: http://knab.ws/blog/index.php?/archives/3-CSV-file-parser-and-writer-in-C-Part-1.html, read: http://knab.ws/blog/index.php?/archives/10-CSV-file-parser-and-writer-in-C-Part-2.html)
Abdullah Dhiab22 reputationPosted Jan 5, 2015, 3:29 AM EST
file is ~50,000 lines and there are 22files
parsing will take long time, i dont know how to optimize it?
Abdullah Dhiab22 reputationPosted Jan 5, 2015, 4:43 AM EST
-------------