Parsing unstructured files with JavaScript
It's ideal to have input files where the information is well-formed, that is, the number of columns and the type of its data is precise, all rows follow the same pattern, and so on. However, it is very common to find input files where the information has little or no structure or the structure doesn't follow the matrix (n rows by m columns) you expect. This is one of the situations where JavaScript can help.
Suppose that you have a file with a description of houses, which looks like the following:
... Property Code: MCX-011 Status: Active 5 bedrooms 5 baths Style: Contemporary Basement Laundry room Fireplace 2 car garage Central air conditioning More Features: Attic, Clothes dryer, Clothes washer, Dishwasher Property Code: MCX-012 4 bedrooms 3 baths Fireplace Attached parking More Features: Alarm System, Eat-in Kitchen, Powder Room Property Code: MCX-013 3 bedrooms ...
You want to compare the properties among them but it would...