TAGS :Viewed: 11 - Published at: a few seconds ago

[ Powershell alternative to Python shlex.split function ]

I am looking for an alternative to the python shlex.split() function for Powershell. Google has not helped me so far.

In case you do not know what this function does, it allows you to split a string into a list of multiple "fields" but excluding quoted substrings.

For example:

The following string: I have "no inspiration" for this

would be split the following way: I, have, no inspiration, for, this

The reason I want to switch to powershell for this is to avoid having to install python on our production windows servers.

Thanks in advance

Answer 1


you should perhaps instead search for awk powershell

which leads to

http://windows-powershell-scripts.blogspot.de/2009/06/awk-equivalent-in-windows-powershell.html