Fast way to replace all Tabs in text file with Pipe?

Moderator: NorbertKrupa

Post Reply
User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Fast way to replace all Tabs in text file with Pipe?

Post by Julie » Thu Nov 14, 2013 10:31 pm

Hi guys,

Anyone have a recommendation for the FASTEST way to replace all tab characters with the pipe symbol in HUGE text files?
Thanks,
Juliette

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1817
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Fast way to replace all Tabs in text file with Pipe?

Post by JimKnicely » Fri Nov 15, 2013 4:33 am

Hi,

So far, the following has worked for me:

Code: Select all

sed -i 's/\t/|/g' file_name
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

User avatar
Julie
Master
Master
Posts: 221
Joined: Thu Apr 19, 2012 9:29 pm

Re: Fast way to replace all Tabs in text file with Pipe?

Post by Julie » Fri Nov 15, 2013 3:58 pm

Thank you, Jim! That works great on CentOS!
Thanks,
Juliette

Post Reply

Return to “Vertica and the Operating System”