I am trying to use a script to replace the header of each file, whose filename are stored within the array $test, using the sed command within a Perl script as follows:
$count = 0;
while ( $count < $#test )
{
`sed -e 's/BIOGRF 321/BIOGRF 332/g' ${test} > 0`;
`cat 0 >... (2 Replies)
Hi,
Is there any way I can grep an array against another array?
Basically here's what I need to do.
There will be an array containing some fixed texts and I have to check whether some files contain these lines. Reading the same files over and over again for each different pattern doesnt seem... (1 Reply)
Hi All,
I wanted to add 1 year to the system date in my script.
say export start_date=`date +%F`
echo $start_date
o/p of this is 2009-09-02
To this i want to add 1 year.
the output i need here is 2010-09-02
can anybody help me ?
Thanks in advance,
Vinay (4 Replies)
Hi Everyone,
#!/usr/bin/perl
use strict;
use warnings;
my @test=("a;b;qqq;c;d","a;b;ggg;c;d","a;b;qqq;c;d");
would like to split the @test array into two array:
@test1=(("a;b;qqq;c;d","a;b;qqq;c;d"); and @test2=("a;b;ggg;c;d");
means search for 3rd filed.
Thanks
find the... (0 Replies)
Hi everyone
I have one question about using array in perl. let say I have several log file in one folder.. example
test1.log
test2.log
test3.log
and the list goes on..
how to make an array for this file? It suppose to detect log file in the current directory and all the log file will... (3 Replies)
I have an array and two variables as below,
I need to check if $datevar is present in $filename.
If so, i need to replace $filename with the values in the array.
I need the output inside an ARRAY
How can this be done.
Any help will be appreciated. Thanks in advance. (2 Replies)
Hi all,
Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM.
Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers.
At the moment am... (3 Replies)
okay so my job is requiring me to learn perl and i have never had any type of programming language... ever.
So i need to take a file that has data (nodes/points) with x, y, and z components.
Example of what the file contains is below:
RANDOM TEXT
RANDOM TEXT
Node # x pos ... (23 Replies)
Discussion started by: dets34
23 Replies
LEARN ABOUT DEBIAN
mp3::tag::cddb_file
MP3::Tag::CDDB_File(3pm) User Contributed Perl Documentation MP3::Tag::CDDB_File(3pm)NAME
MP3::Tag::CDDB_File - Module for parsing CDDB files.
SYNOPSIS
my $db = MP3::Tag::CDDB_File->new($filename, $track); # Name of audio file
my $db = MP3::Tag::CDDB_File->new_from($record, $track); # Contents of CDDB
($title, $artist, $album, $year, $comment, $track) = $db->parse();
see MP3::Tag
DESCRIPTION
MP3::Tag::CDDB_File is designed to be called from the MP3::Tag module.
It parses the content of CDDB file.
The file is found in the same directory as audio file; the list of possible file names is taken from the field "cddb_files" if set by
MP3::Tag config() method.
parse()
($title, $artist, $album, $year, $comment, $track) =
$db->parse($what);
parse_filename() extracts information about artist, title, track number, album and year from the CDDB record. $what is optional; it
maybe title, track, artist, album, year, genre or comment. If $what is defined parse() will return only this element.
Additionally, $what can take values "artist_collection" (returns the value of artist in the disk-info field DTITLE, but only if author
is specified in the track-info field TTITLE), "title_track" (returns the title specifically from track-info field - the "track" may
fall back to the info from disk-info field), "comment_collection" (processed EXTD comment), "comment_track" (processed EXTT comment).
The returned year and genre is taken from DYEAR, DGENRE, EXTT, EXTD fields; recognized prefixes in the two last fields are YEAR, ID3Y,
ID3G. The declarations of this form are stripped from the returned comment.
An alternative syntax "Recorded"/"Recorded on"/"Recorded in"/ is also supported; the format of the date recognized by ID3v2::year(), or
just a date field without a prefix.
title()
$title = $db->title();
Returns the title, obtained from the 'Tracktitle' entry of the file.
artist()
$artist = $db->artist();
Returns the artist name, obtained from the 'Performer' or 'Albumperformer' entries (the first which is present) of the file.
track()
$track = $db->track();
Returns the track number, stored during object creation, or queried from the parent.
year()
$year = $db->year();
Returns the year, obtained from the 'Year' entry of the file. (Often not present.)
album()
$album = $db->album();
Returns the album name, obtained from the 'Albumtitle' entry of the file.
comment()
$comment = $db->comment();
Returns the 'Trackcomment' entry of the file. (Often not present.)
genre()
$genre = $db->genre($filename);
perl v5.14.2 2009-04-15 MP3::Tag::CDDB_File(3pm)