Search This Blog

Tuesday, December 11, 2012

Get The File Names From A Folder

Ok, when some DOS gurus see this post, they might laugh. But for me, in one of the projects, this was a real life saver and a value add to the client.

So the tip - It is not the quantity of the code which creates value; but, how it is being used :)
Like the saying: Even a grass can be a good tool at the right time.

The command is this: DIR /B /ON *.* > MyMusicList.txt

The example here, is the requirement to get the list of the file names in my music folder, to share with a friend, so that he can select the ones he like.


So first I went to the root folder where I have kept all music collections.And then fired the command and gave a target file name.

Then I can see the file MyMusicList.txt generated under the same path where I have kept the music files, which has all the music file names exported.




Now the real power is not getting some music files. But how to use it for adding value to any application we work on.

What if there are files in the PeopleSoft file server that need to be accessible to the client online? There you go.

Archiving the data

I am not very much into the PeopleSoft data archiving part. 

But in the fast few months, while creating our own applications to sell, we had requirements to create archive tables for most of the app related online tables. And what we used to do it is to create app specific stand alone archiving process.

As you might know being a DBA geek, delivered archiving process is having a best practice in it. And it is not tough to use also. Only thing to fit our history tables into the archiving stack is to add the sub record - PSARCHIVE_SBR.

And then you can populate the values using PS Queries and can run a AE program to clean up the data. Everything can be beautifully configured and execute.

Sweet!

Recommended method.