I will start receiving many large CSV files, of which only the first few lines are of interest to me. I was hoping to open them by piping only the first few lines to Calc, but this doesn't work:

$ libreoffice4.1 --calc <(head large_file.csv)

Upon trying this, I get a popup:

/dev/fd/63 does not exist.

Is there any easy way to open only the first few lines without creating a new (temporary) file? This is on Kubuntu Linux 12.10 with LibreOffice 4.1.

  • 1
    Does it need to be in libreoffice? I mean, a simple cat or less won't do? – terdon Jan 3 '14 at 2:10
  • I prefer Calc as the lines are long (over 30 columns) and are of arbitrary length. I (human) need to read real data out of them. – dotancohen Jan 3 '14 at 2:20
  • 2
    Does this q/a solve your issue? – tohuwawohu Jan 3 '14 at 7:00
  • @tohuwawohu: Yes, it does set me in the right direction to answer the question. You can link to that post or paraphrase it as an answer, and I'll accept. Thank you tohuwawohu! – dotancohen Jan 3 '14 at 11:24

Instead of using an unnamed pipe, why not use a named pipe. For example:

% mknod p pipe
% (head large_file.csv > pipe &); libreoffice4.1 --calc pipe
  • Thank you, beautiful solution! It is a rarity when a knowledgeable answer is posted over a year after the question! – dotancohen Mar 21 '15 at 21:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.