Ask Your Question

How do I automatically import numbers from a text document to a cell or cell area in Libre Calc? [closed]

asked 2013-11-15 07:20:40 +0200

binarygirl gravatar image

Hi all, I have a lot of text documents to copy into Libre Calc sheets. I can't do regular file import because there is other stuff in the sheet as well. I would like to have either each cell call numbers from the text document, or import the file into a certain cell range/area of the sheet. I don't want to just copy/paste the text files because this gets very time consuming when there are a lot of them!

Is there an automated function for this or a command-method to do this? If not, is there a way to write a script that would get the files? Would some kind of macro work? The text files are all organised into columns by being tab or space delimited.

Thank you all very much for the help!!

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2015-11-14 19:42:51.779911

1 Answer

Sort by » oldest newest most voted

answered 2013-11-15 13:51:14 +0200

m.a.riosv gravatar image

updated 2013-11-20 22:49:32 +0200

What you can do, depends on how the data are in the source document. Please can you show a sample.

Updated 20131120

For those files without changes in the file name, I think the better way is through Menu/Insert/Sheet, mark the link option before finish, data are inserted in a new sheet the first time, in this way you can update in Menu/Edit/Links.
Another way for those changing, is using the INDIRECT() function to create a link changing the name of the linked file when you want, but is needed a hard recalc [Ctrl+Shift+F9] before links are visible in Menu/Edit/Links for update.

Getting the folder for the file in use:
Folder: =LEFT(CELL("filename");SEARCH("/[^/]+'#";CELL("filename")))
Set up the file number:
FileNumber: = xxx
Sheet2.A1: =INDIRECT(Folder&"File"&FileNumber&".csv.'#Sheet."&CELL("ADDRESS"))
This link with cell A1 in the Filexxx.csv, copying the formula you can populate retrieving the values for the same cell in the source file.

edit flag offensive delete link more


hello & thank you for answering! the source files are all just 16 (columns) x 100 (rows) *.txt files of tab delimited real numbers. they are all named as outfile#.txt, where the # is increasing integers does that help? thank you again

binarygirl gravatar imagebinarygirl ( 2013-11-18 17:03:45 +0200 )edit

Have the files the same numbers in the name? or they are always increasing?

m.a.riosv gravatar imagem.a.riosv ( 2013-11-19 05:09:36 +0200 )edit

Hi again :) I have both types where the numbers increase and where they stay the same.

binarygirl gravatar imagebinarygirl ( 2013-11-20 04:59:56 +0200 )edit

Im unsure will this answer my question here...

King_ZZ gravatar imageKing_ZZ ( 2015-09-11 19:24:36 +0200 )edit

Question Tools

1 follower


Asked: 2013-11-15 07:20:40 +0200

Seen: 1,716 times

Last updated: Nov 20 '13