hi Geeks,
my input file contains data like =>
I had used sed command to remove the prefix from the file name like
it gives me the perfect result. but now I want the same result by using the perl substitution.
I tried this command
but unfortunately it doesn't return anything and echo $? returns 0.
Kindly advise .. thanks in advance.
-Lohit.
Last edited by Scott; 09-17-2013 at 03:04 PM..
Reason: Code tags
Hi
I need an equivalent command in PERL for the following.
export LC_ALL=C;
I hope this is the command. Please confirm this and correct me if i am wrong
$ENV{LC_ALL}="C";
Thanks and Regards
Ammu (1 Reply)
Guess the subject lines says it all.
What is the perl equivalent to grep -c
-c, --count
Suppress normal output; instead print a count of match-
ing lines for each input file. With the -v, --invert-
match option (see below), count non-matching lines.
... (6 Replies)
In Perl I can write a condition that evaluates a match expression like this:
if ($foo =~ /^bar/) {
do blah blah blah
}
How do I write this in shell? What I need to know is what operator do I use? The '=~' doesn't seem to fit. I've tried different operators, I browsed the man page for... (3 Replies)
Dear All,
Good day, can any of you help me in the following problem:
I need to find the perl equivalent for the following commandline
grep characters |awk '{print \$2}'Expecting your reply and thanks in advance.
Warm regards
Fredrick. (4 Replies)
I have to do grep -v in a perl script. I want to exclude blank lines and lines having visitor.
#grep -v visitor abc.txt |grep '.'
file:abc.txt
1340 not booked 16D:D9 tourist 8
1341 not booked 16C:D4 tourist 25
1342 not booked 16D:C4 visitor 7
1343 not booked 01C:D9 visitor 6
1344... (4 Replies)
Hello,
I searched online; it seems that perl use $NR as NR in awk; however it does not work for me. For example, how to re-write the following awk using perl:
awk '{ print NR}' inputfile---------- Post updated at 01:55 PM ---------- Previous update was at 12:49 PM ----------
I found... (2 Replies)
Ive been trying to move to Perl. It has been a struggle.
My question is, is there a good resource that explains nesting statements.
As an example.
To change
primary
Factory CTS 1.9.0(46) P1
*Slot 1 CTS 1.10.2(42) P1
To
primary *Slot 1 CTS 1.10.2(42) P1
... (5 Replies)
Discussion started by: popeye
5 Replies
LEARN ABOUT DEBIAN
tagmp3
tagmp3(1) User manual tagmp3(1)NAME
tagmp3 - manipulate ID3v1 tags
SYNOPSIS
tagmp3 [ -n ] mode [ format ] [ file ] ...
DESCRIPTION
tagmp3 allows you to set and remove ID3v1 tags from mp3 files. Additionaly move mode can be used to move mp3 files according to their ID3v1
tag. An ID3v1 tag is a chunk of extra informations such as artist name, album and genre. ID3v1 tags are displayed by most mp3 players.
MODE
show show file's ID3v1 tag.
set sets file's ID3v1 tag according to format.
move move file to a destination based on FORMAT.
del remove file's ID3v1 tag if any.
list displays numeric music genres along with their meaning.
-h print a (not so) short help message.
-v print version and exit.
OPTIONS -n Show what will be done, don't alter any file.
FORMAT STRING
The format string is a character string composed of zero or more directives: ordinary characters (not %), which are not interpreted and
conversion specifications, each of which results in the corresponding ID3v1 tag field substitution. Each conversion specification is
introduced by the character %. The following lines describes each conversion specification along with its associated ID3v1 field. Special
sequence %% is substituted with a single %.
%A Artist Name
%a Album Name
%t Song Title
%T Track Number
%y Year
%g Genre
%c Comments
format string for set mode
For set mode the format string is a list of ID3v1 fields followed by a ':' (next chars are the field value) or a '?' (ask user for field
value)
example: tagmp3 set "%A:Pink Floyd %a:The Wall %t? %T?" *.mp3
For each mp3 of this directory, sets the artist name to Pink Floyd and the album to The Wall. For each file ask for the title and
the track number. Leave the other fields untouched. Be aware that genre field require a numeric value. Known genres can be dis-
played with the list mode.
format string for move mode
The format string is the destination path where each field identifier is substituted with the tag value.
example: tagmp3 move "/home/foo/mp3/%A/%a/%T-%t.mp3" *.mp3
with the set example above will move all mp3 to "/home/foo/mp3/Pink Floyd/The Wall/{track}-{title}.mp3"
If you prefer the "flat" naming scheme, you will use something like
tagmp3 move "%A-%t.mp3" *.mp3
NOTES
move mode never overwrite files.
move mode creates intermediate directories specified in the format string. Each directory creation is to be confirmed by the user.
ID3v2 tags are not supported so far.
If a file can't be moved ( wrong file type, ID3v1 tag absent or blank field , ...) then it is left untouched.
Fake mp3 (i.e. Wave file with .mp3 extension) are moved into "fake-mp3/" directory in move mode. set mode refuses to tag them since this
would add noisy artifact at the end of the song.
BUGS
Plenty of :)
For move mode, source and destination must reside on the same file system / partition.
AUTHOR
Laurent Alacoque <laureck@users.sourceforge.net> CopyLeft 2001
Bugs, patch, infos, new releases, girls, money go to :
http://mpgtx.sourceforge.net/
Linux APRIL 2001 tagmp3(1)