Ripgrep: Feature request: Make rg possible to change delimiter from colon

Created on 20 Jan 2019  路  2Comments  路  Source: BurntSushi/ripgrep

What version of ripgrep are you using?

ripgrep 0.10.0
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)

How did you install ripgrep?

I install ripgrep from the arch official repos.

What operating system are you using ripgrep on?

Arch Linux

Describe your question, feature request, or bug.

When I execute the following command, the file path, line number, contents are displayed in a colon delimiter.

$ rg --no-heading --line-number .
test.txt:1:hogehoge
test.txt:2:fugafuga
test.txt:3:piyopiyo

I'd like to change the delimiter to anything.

Replacing by sed will fail if the file path contains some colons.
So I want to specify an other delimiter character in ripgrep.

Thank you.

question

Most helpful comment

Replacing by sed will fail if the file path contains some colons.
So I want to specify an other delimiter character in ripgrep.

This is basically what the -0/--null flag is for, because the NUL byte is the only byte that is illegal in a file path on Unix.

Otherwise, if you need a more structured format for parsing, you might consider using --json.

All 2 comments

Replacing by sed will fail if the file path contains some colons.
So I want to specify an other delimiter character in ripgrep.

This is basically what the -0/--null flag is for, because the NUL byte is the only byte that is illegal in a file path on Unix.

Otherwise, if you need a more structured format for parsing, you might consider using --json.

-0/--null is exactly what I needed!
Thank you very much!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

wsdjeg picture wsdjeg  路  3Comments

bastienbc picture bastienbc  路  3Comments

fcantournet picture fcantournet  路  3Comments

danpintara picture danpintara  路  3Comments

chopfitzroy picture chopfitzroy  路  3Comments