prad_intel has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I have almost finished the tool which i had to but again there are change requests.

Well now the new problem is ..

1)I have to read particular information from a file , say info.txt

2)The info in the file is something like the following- Log_file_name:XXXX.csv

Main_folder_name:YYYY

Second_folder_name:ZZZZZ

Third_folder_name:VVVVV

3)I have to write the code something like

#whatever after Log_file_name: place it into $logfile

#whatever after Main_name: place it into $mainfold

#whatever after Second_folder_name: place it into $secfold

#whatever after Third_folder_name: place it into $thirdfold

4) Also kindly enlighten me how to read the date and time from the system and print in log.csv

prad

again

  • Comment on Reading something which is next to it :

Replies are listed 'Best First'.
Re: Reading something which is next to it :
by Random_Walk (Prior) on Feb 02, 2005 at 12:28 UTC

    As you gave no code neither shall I ;-)

    For the various fields try splitting on : and testing the first value to see which one it is, or if they will always be in that order with nothing intervening just do the split and write the parts out in order. You will have to open the various files you want to write to, it's polite to close them after you have written too.

    For the time locatime gives you it in epoch seconds, you can get a lot of nice formats if you use POSIX and then strftime ('format', localtime). Google on strftime.

    Cheers,
    R.

    Pereant, qui ante nos nostra dixerunt!
    A reply falls below the community's threshold of quality. You may see it by logging in.