I am new to programming and also to perl..But i know 'perl' can come to my rescue, But I am stuck at many places and need help..any small help is much appreciated... below is the description of what i intend to acheive with my script.
I have a files named in this format 01112008_abcd_xyz.dat (100s of such files) and they are presently in the following directory C:/Doc and settings/myname/rawdata/*.dat
My script has to acheive
creation of folder C:/Doc and settings/myname/rawdata/abcd/011112008/*.dat
so folders have to be created according to part of a name of the .dat files, that i have..then transfer the respective *.dat files inside those folders
Plssss help lastly I am using Windows ..thanks
xytiz
Thanks for the reply.. I have now got to a stage where i have the folder abcd in place but i need to create abcd/011112008/*.dat ..so i used opendir to go inside "abcd" folder and again call makedir function i have written but i think I need to set the o/p put path unlike windows where you open the dir and do create dir ..
Again thanks for your help ..any further inputs on this will be very helpful...
i dont' really understand what you want to do. if you want to create multiple directory levels, mkpath should be ok. read the docs for File::Path and see examples of how to use mkpath.
My question was i am unable to create multiple directories
below is my code mkpath does not help much either..I have tried few things like "\" and "//" and "\ /" nothing seem to work ...
sub makeDir
{
my $new_dir = shift;
if (!(-e "$new_dir"))
{
mkpath([$new_dir �/� $Date], 1, 0777);
#mkdir ($new_dir $rncDate,777);
print "( $new_dir ) Directory has been created.\n";
}
}# end sub makedir
Is there a way to run the perl script > then Excel macro > Then come back to perl script.. The perl script can the same or diff it doesn't really matter i can split the file into two..if that the case..
I need to update the array list dynamically which i am unable to do ..Pls help or give directions which i can work out...following the my code
if (@abc == ())
{
$abc[0] = $lineOfData[0];
}
else
{
$abc[$#abc+1] = $lineOfData[0];
\#update the "abc" array ? here it should have the update number of elements by the end of this loop the above code does not ensure that :-\(
if (@abc) { #<-- @abc is not an empty array so append the other array to the end of it:
@abc = (@abc,@lineOfData); #combine the two arrays
}
else {
@abc = @lineOfData;
}
Assumes you want @abc to have all the elements of @lineOfData in the same order or append @lineOfData to the end of @abc if @abc already has some data in it.