Parsing user agent strings

esuriency

New Member
Joined
Aug 7, 2017
Messages
3
Is there a macro or module out there that would parse agent strings? Just looking for Device Type, Operating System, Browser.
For example:
Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13G36 Safari/601.1
Tablet, iOS 9.3.5, Safari Mobile 9.0
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
There's so many variations (see examples here) and I don't see any consistent patterns to them.

Example Input and Outputs
Source DataOS (Output)Browser (Output)
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36Windows 10Chrome 60
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like GeckoWindows 10Internet Explorer 11
Mozilla/5.0 (iPad; CPU OS 9_3_5 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13G36 Safari/601.1Mac OS iPadSafari 9

<tbody>
</tbody>
 
Upvote 0
Well that's a problem then.

If there is no consistent pattern, I don't see how anyone can write a formula or programme to do this job.

You could perhaps store all your target values in a range somewhere, and then test whether each input contains ANY of the target values, but that's a bit complicated.

And maybe more so, given that some of your outputs don't seem to even be in the input values.
For example, in entry 1, is the solution supposed to recognise that "Windows NT 10.0" is the same as "Windows 10" ?
For example, in entry 1, is the solution supposed to recognise that "Chrome/60" is the same as "Chrome 60", or maybe any instance of "Chrome" should be identified as "Chrome 60" ?
For example, in entry 2, how do we identify Internet Explorer 11 ?
For example, in entry 3, how do we identify Safari 9 ?

The answers to the above may be obvious to you, but we need to devise a systematic way of working out the answers, and you need to help us on how to do that exactly.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top