Last weekend I tried ice fishing for the first time this winter. The day was great, sunny and temps in the high 30s, but the fish weren’t biting. Not only did we not see a fish, but we didn’t see anyone else on the lake catch anything. Back in the office this week I talked to a few other men who had gone out to different lakes and everyone had the same results. It ended up just being a bad weekend to fish. I also ran into an issue where some ice that I stepped on sank perceptably under my feet. The ice we were fishing was 10 – 12 inches thick, but it still wasn’t great ice. Down in Lake Geneva this weekend, over 50 cars sank through the ice into the lake this weekend as well. Remember to always be careful when ice fishing, even if it appears safe.
2016-02-09 06:35:43,923 [WT-2 ] TRACE Fsms.Interface.OpenShipHelper - [ProcessOpenShipShipment] FSMS Request: 0,"20"4,""5,"182 S. County Fake 4 E"7,"Avone"8,"AK"9,"46133"23,"1"32,"Tammy Fake"50,"US"75,"LBS"79,"Return Package"117,"US"183,"317-555-5555"498,"54224591"541,"YNNNNasdfNNNN"542,"002693156062"1273,"1"16570,"10"22510,"2680079"24175,"7"30557,"26805079"995,""
2016-02-09 06:35:43,924 [WT-2 ] TRACE Fsms.Interface.Communications.FsmsSocketClient - [SendFsmsString] request: 0,"20"4,""5,"182 S. County Fake 900 E"7,"Avone"8,"AK"9,"46145623"23,"1"32,"Tammy Fake"50,"US"75,"LBS"79,"Return Package"117,"US"183,"317-504459-19786795"498,"5426291"541,"YNNNNasdfNNNN"542,"00269376062"1273,"1"164570,"10"222410,"2680456079"2417,"7"305647,"2680456079"99,""
All the records I’m interested in follow the format of the record above that is bolded and italicized above. To parse the table, I need to divide it into three sections – the first will be the log date and time, the second will be some filler information that I don’t need, and the third will be the section that I want to delimit.
I’m going to put those three fields into a common table expression, and then use the third field to parse.
I hope this has given a good demonstration on how to use OUTER APPLY to parse a delimited file.