Sponsored Content
Top Forums Shell Programming and Scripting perl script to split the filename Post 302680505 by giridhar276 on Thursday 2nd of August 2012 02:23:13 AM
Old 08-02-2012
Many thanks kamaraj.

I am writing the script in perl and here the filename is assigned to a variable.
So Could you please make use of variable which contains the filename and then split it.

$filename = "theme1.htm";
Now I need to print only 1.

---------- Post updated at 01:23 AM ---------- Previous update was at 01:20 AM ----------

Many thanks kamaraj ... It worked... Smilie

ThanQ bmk...
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Use same filename for prefix in the split command

I want to execute something like this: find . -type f -regex '$REGEX' -print | xargs split -d -C $SIZE The problem is that I want the name of the split files to be the same name as original files. So if my directory has two files called abc.txt and def.txt, then I want the split files to be... (1 Reply)
Discussion started by: namityadav
1 Replies

2. Shell Programming and Scripting

Perl: Filename expansion?

Hi, I do not know if my subject is right, but I at least have your attention :) Recently I posted a perl question related to this. Now when someone starts my program using an asterics: ./dirinfo.pl /orapkg/ora0*/oradata/ It can contain multiple directories. The following command shows... (6 Replies)
Discussion started by: davidg
6 Replies

3. Shell Programming and Scripting

Perl Script : Split given month into weeks

I want to split a given month into weeks. For example if I give the date in dd/mm/yy format say 01/02/08 it should give output in the given format : week1 : start date and end date. week2 : "" week3 : "" week4 : "" (5 Replies)
Discussion started by: khushbu_roy
5 Replies

4. AIX

split a filename and print to 2 different headings

I need help to split a filename 'a0crk_user:A0-B0123$#%test' into a0crk_user and A0-B0123 and print the output under 2 different columns namely User and Status. for eg. the output should like below: User Status ---- ------ a0crk_user A0-B0123 (3 Replies)
Discussion started by: mbak
3 Replies

5. Shell Programming and Scripting

directory -l filename perl

Can anybody let me know what following commands will do in perl 1.my $result = `/main/home/bin/iwex -l '$File1'`; 2.my $setcmd = "/main/home/bin/iwex -s \"$File2\" \"$File3\""; where $File1 $File2 $File3 are regular files. Please suggest something. Ur welcome (4 Replies)
Discussion started by: millan
4 Replies

6. Shell Programming and Scripting

how to get split output of a file, using perl script

Hi, I have file: data.log.1 ### s1 main.build.3495 main.build.199 main.build.3408 ###s2 main.build.3495 main.build.3408 main.build.199 I want to read this file and store in two arrays in Perl. I have following command, which is working fine on command prompt. perl -n -e... (1 Reply)
Discussion started by: ashvini
1 Replies

7. Shell Programming and Scripting

Perl script error to split huge data one by one.

Below is my perl script: #!/usr/bin/perl open(FILE,"$ARGV") or die "$!"; @DATA = <FILE>; close FILE; $join = join("",@DATA); @array = split( ">",$join); for($i=0;$i<=scalar(@array);$i++){ system ("/home/bin/./program_name_count_length MULTI_sequence_DATA_FILE -d... (5 Replies)
Discussion started by: patrick87
5 Replies

8. Shell Programming and Scripting

Split Filename from Absolute Path

Hello, I have the string "/a/b/c/ddd.txt" and i want to get only the filename, in this case "ddd.txt". I have as something known in the script the pattern "/a/b/c/", so I`ve tried something like: echo "/a/b/c/ddd.txt" | cut -d "/a/b/c/" -f2 but it doesn`t go, any help?. thanks, bye (2 Replies)
Discussion started by: rubber08
2 Replies

9. Shell Programming and Scripting

perl script to split the text file after every 4th field

I had a text file(comma seperated values) which contains as below 196237,ram,25-May-06,ram.kiran@xyz.com,204183,Pavan,4-Jun-07,Pavan.Desai@xyz.com,237107,ram Chandra,15-Mar-10,ram.krishna@xyz.com ... (3 Replies)
Discussion started by: giridhar276
3 Replies

10. Shell Programming and Scripting

Modification of perl script to split a large file into chunks of 5000 chracters

I have a perl script which splits a large file into chunks.The script is given below use strict; use warnings; open (FH, "<monolingual.txt") or die "Could not open source file. $!"; my $i = 0; while (1) { my $chunk; print "process part $i\n"; open(OUT, ">part$i.log") or die "Could... (4 Replies)
Discussion started by: gimley
4 Replies
Image::ExifTool::RIFF(3pm)				User Contributed Perl Documentation				Image::ExifTool::RIFF(3pm)

NAME
Image::ExifTool::RIFF - Read RIFF/WAV/AVI meta information SYNOPSIS
This module is used by Image::ExifTool DESCRIPTION
This module contains routines required by Image::ExifTool to extract information from RIFF-based (Resource Interchange File Format) files, including Windows WAV audio and AVI video files. AUTHOR
Copyright 2003-2011, Phil Harvey (phil at owl.phy.queensu.ca) This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. REFERENCES
http://www.exif.org/Exif2-2.PDF <http://www.exif.org/Exif2-2.PDF> <http://www.vlsi.fi/datasheets/vs1011.pdf> http://www.music-center.com.br/spec_rif.htm <http://www.music-center.com.br/spec_rif.htm> <http://www.codeproject.com/audio/wavefiles.asp> http://msdn.microsoft.com/archive/en-us/directx9_c/directx/htm/avirifffilereference.asp <http://msdn.microsoft.com/archive/en- us/directx9_c/directx/htm/avirifffilereference.asp> <http://wiki.multimedia.cx/index.php?title=TwoCC> SEE ALSO
"RIFF Tags" in Image::ExifTool::TagNames, Image::ExifTool(3pm) perl v5.12.4 2011-01-03 Image::ExifTool::RIFF(3pm)
All times are GMT -4. The time now is 03:23 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy