Joe B
Joe B

Reputation: 1022

sed creates empty file after replacement operation

sed -i '' 's/|/     /g' largefile.tsv > outfile.tsv

I've got a rather large 37 gb file that I'm trying to replace '|' with '\t' but after running for a long time, sed only outputs an empty file (0 bytes).

I'm running on macOS. What am I missing?

Upvotes: 0

Views: 2009

Answers (1)

choroba
choroba

Reputation: 242038

With -i, the input file changes "in place", and there's no output to redirect to a file.

Upvotes: 1

Related Questions