comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Writing each filename into new line of text file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Writing each filename into new line of text file [message #91065 is a reply to message #91060] Fri, 29 May 2015 13:43 Go to previous messageGo to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
On Friday, 29 May 2015 05:48:43 UTC-7, Kai Heckel wrote:
> Hey!
>
> I'd like to list my files and write them into a text file. Each filename should be in a separate line....
> Shouldn't be to hard ;)
>
> This is what I have:
>
> PRO test
> cd, 'Path of my files'
> files_all = FILE_SEARCH()
> openw,lun1,'fileinfo.txt', /get_lun
> printf, lun1, files_all, FORMAT='(A)'
> close, lun1
> free_lun,lun1
> END
>
> I couldn't find any suitable command till now...
>
> Thanks!

As we often ask around here, "in what way is this not working for you?". When I run this, it does write every filename on a separate line, as expected. It also seems to be listing contained folders... is that the problem? If so, use this instead:

files_all = FILE_SEARCH(/TEST_REGULAR)

Bonus: if you're going to do "free_lun", you don't have to do "close"!

Cheers,
-Dick

Dick Jackson Software Consulting Inc.
Victoria, BC, Canada --- http://www.d-jackson.com
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: NEWTON: Roundoff problem in lnsrch_d
Next Topic: Confused about image dimensions

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 18:12:24 PDT 2025

Total time taken to generate the page: 0.00396 seconds