Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11883 > unrolled thread
| Started by | Dominik Hezel <sendme2000@me.com> |
|---|---|
| First post | 2012-09-27 07:40 +0000 |
| Last post | 2012-09-29 07:08 +0000 |
| Articles | 3 — 3 participants |
Back to article view | Back to comp.soft-sys.math.mathematica
Import multiple files with same extension from a folder Dominik Hezel <sendme2000@me.com> - 2012-09-27 07:40 +0000
Re: Import multiple files with same extension from a folder Yves Klett <yves.klett@googlemail.com> - 2012-09-28 03:08 +0000
Re: Import multiple files with same extension from a folder Murta <rodrigomurtax@gmail.com> - 2012-09-29 07:08 +0000
| From | Dominik Hezel <sendme2000@me.com> |
|---|---|
| Date | 2012-09-27 07:40 +0000 |
| Subject | Import multiple files with same extension from a folder |
| Message-ID | <k40vu9$ja9$1@smc.vnet.net> |
Hello, I have a folder with different files, e.g. test1.exp test2.exp test1.log test2.log ... The number of files and actual file names is unknown. I would like to import all files ending with .exp. How do I do this rather simple task? Thanks for any help.
[toc] | [next] | [standalone]
| From | Yves Klett <yves.klett@googlemail.com> |
|---|---|
| Date | 2012-09-28 03:08 +0000 |
| Message-ID | <k434bq$ndu$1@smc.vnet.net> |
| In reply to | #11883 |
The following suggestion is from:
http://mathematica.stackexchange.com/q/5242/131
*snip*
Have a look at FileNames:
files=FileNames["*.pdf", NotebookDirectory[]]
{"a.pdf","b.pdf","c.pdf"}
will get you a list of all files in the directory where your notebook
resides (of course you can choose any path) that match "*.pdf". You can
then import the files like this:
Import[#]&/@files
or if you want certain files (look at the help for Part and Span):
Import[#]&/@files[[-3;;-1]] (*last three files*)
Import[#]&/@files[[1;;10]] (*first ten files*)
*snip*
Regards,
Yves
Am 27.09.2012 09:40, schrieb Dominik Hezel:
> Hello,
>
> I have a folder with different files, e.g.
>
> test1.exp
> test2.exp
> test1.log
> test2.log
> ...
>
> The number of files and actual file names is unknown. I would like to import all files ending with .exp. How do I do this rather simple task?
>
> Thanks for any help.
>
[toc] | [prev] | [next] | [standalone]
| From | Murta <rodrigomurtax@gmail.com> |
|---|---|
| Date | 2012-09-29 07:08 +0000 |
| Message-ID | <k466pv$a88$1@smc.vnet.net> |
| In reply to | #11883 |
Hi Try this to get file names: SetDirectory["~/Desktop"] files=FileNames["*.exp"] Import/@files best regards Murta On Thursday, September 27, 2012 4:42:23 AM UTC-3, Dominik Hezel wrote: > Hello, > > > > I have a folder with different files, e.g. > > > > test1.exp > > test2.exp > > test1.log > > test2.log > > ... > > > > The number of files and actual file names is unknown. I would like to import all files ending with .exp. How do I do this rather simple task? > > > > Thanks for any help.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web