I need substring from the file name of list of files. I mean i will have to load all the files into database which are there in the Directory.
I need to make the directory with the date(which is substring of the filename Eg: Filename_Name_2012013001010101.txt, So the directory should be 20120130).
I need to load this file into oracle and need to move the file into above created directory.
It should happend till all files are loaded into database. Could someone give the ideas?
But forgot to tell you that Filename may have numbers as well apart from Date and Full file name will have n. number of underscores. What i need is we should pick up the date from end of the file name as it has date and time before the extension of file.
this is only half the necessary information: there is Korn shell 88 and Korn shell 93 and they differ in some respects (ksh93 has some features ksh88 has not). Which one are you using? And while you are at it: the name and version of the OS sometimes also matters, so you better [i]always[/i state this information ideally at the top of any new thread.
Some OSes (HP-Ux, Solaris) will show the version too this way, some have other commands for this:
AIX text oslevel -g
Linux - Redhat and consorts (Fedora, CentOS, ...) text cat /etc/redhat-release
Linux - Slackware text cat /etc/slackware-version
Which ksh-version:
I am not sure if every ksh version understands this - the AIX version doesn't, for instance. The "--" to introduce worded options is a Linux speciality and not common everywhere. What is guaranteed to work is: