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

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 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

Sort by » oldest newest most voted

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.

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

( 2013-11-18 17:03:45 +0100 )edit

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

( 2013-11-19 05:09:36 +0100 )edit

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

( 2013-11-20 04:59:56 +0100 )edit