Escape semicolon or comma in log parser 2.2

1.1k Views Asked by At

Can we escape semicolon (;) or comma (,) in log parser query? Because I want to query a file which is having ';' in file path. For example If I query a file which is placed under the folder named "ab;c"

C:\Program Files (x86)\Log Parser 2.2>LogParser -i:CSV "select * from 'G:\ab;c\123.csv'"

getting the below error

Error: Error opening files: Error opening file "G:\ab": The system cannot find the file specified.

The folder path is getting terminated with the occurrence of semicolon or comma. I have tried with replacing the character with Unicode, but still the same result. Is there any solution? or is it a limitation ?

Thanks in advance

2

There are 2 best solutions below

0
On

Semicolon and comma are both used as the path separator when parsing multiple CSV files. To include them in a path, just surround the entire path in single quotes. I'm not sure which single-quote character you're using, but for me it works:

logparser -i:CSV "select * from 'c:\ab;c:\123.fag'"
Error: Error opening files: Cannot find file "c:\ab;c:\123.fag"
0
On

If you are using Log Parser Studio and try to query semicolon separated values, Use the TSV input format instead - you can use -iSeparator:; for this.

See this thread