0

I have a huge huge string of text that I have on copy / paste , how is the best way to write this to a file. It crashes any GUI text editors I have and when i try use vi / nano it takes forever.

I am running OSX on Macbook Pro i5

Text editors I have tried are textedit, textmate, vi and nano

Community
  • 1
  • 1
h00j
  • 308
  • 1
  • 7
  • 18
  • "Takes forever" is not very scientific. Since you already have it on the clipboard (that's what I assume you mean when you say "on copy/paste"), open vim with `vim foo.txt`, hit `i`, then paste (`CMD` (the apple logo key) +`V` Terminal), just wait for the text to be pasted, hit `ESC`, then type `:wq` and hit enter. – Burhan Khalid May 24 '12 at 19:57
  • Where does the huge string come from? Another file? A web page? – David Harris May 24 '12 at 19:57

2 Answers2

0

This might be useful : pbcopy

This existing post is also related to your issue : Pipe to/from the clipboard

Community
  • 1
  • 1
FloS
  • 19
  • 2
0

This is one way:

xclip -o > file
kavai77
  • 6,282
  • 7
  • 33
  • 48