Hi:
How can I use perl to do the following -
--Look for a file on a filesystem containing a string such as
"Product Name 1.0.0.0.0"
--Then get the disk location path of the file and store the path in a variable.
--Pass the variable to an external java program.
Thanks a lot!
--
To unsubscribe,
Hi:
I see these errors when i run my perl script.
Unrecognized escape \B passed through at C:\test.pl line 41.
Unrecognized escape \o passed through at C:\test.pl line 41.
Unrecognized escape \W passed through at C:\test.pl line 41.
Unrecognized escape \W passed through at C:\test.pl line 41.
Unr
Hi:
In case the string i am looking for is secondlast position as in
instance/bit/bitGroup/default/tz/l_cs/messages
How can i change the manip code to get l_cs in this case?
Thanks!
On 2/16/07, John W. Krahn <[EMAIL PROTECTED]> wrote:
Nishi Bhonsle wrote:
> Hi:
Hello,
> I h
Hi:
I have a string such as
instance/bit/bitGroup/default/tz/l_cs
where the last directory stands for os languages.
I have to get the last directory and assign it to a var such as
$mylang = l_cs, in the above example.
How can i achieve that?
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
uot;%HOME%/$src" "$src"
I tried putting the chomp($src) after the 1st foreach loop and test and
then put it after the second foreach loop and test. Neither works.
On 7/25/06, bright true <[EMAIL PROTECTED]> wrote:
>
> remove the new line from $src , using
>
>
Hi:
The following code ends up adding new line after each column/field in the
record $record in FILE2.
#!/usr/bin/perl
use strict;
use warnings;
use File::Basename;
use File::Find;
use IO::All;
my $path = $ARGV[0];
my $io = io($path);
my @new = $io->all_files; #get all files under $path
forea
I got the last soln, ie to use File::Basename module. Please ignore the last
thread.
I am still interested to know why Rob's soln doesnt work for me?
Thanks much!
On 7/25/06, Nishi Bhonsle <[EMAIL PROTECTED]> wrote:
Hi:
In addition can i modify the all_files to return only t
Hi:
In addition can i modify the all_files to return only the absolute filename
and not the filename alongwith the entire path?
Currently, it prints
C:\..\..\..\File1.txt
etc
I really want it only print File1.txt
Thanks!
On 7/25/06, Nishi Bhonsle <[EMAIL PROTECTED]> wrote:
Yes, all
Yes, all_files works. Its in the doc, and i missed it. Its my bad.
Rob, I tried the code snippet you mentioned, apparently it doesnot return
anything under the directory.
Thanks, Nishi.
On 7/25/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
Rob Dixon schreef:
>use strict;
>use warnings;
>
>
including the subdirectory listing.
Thanks, Nishi.
On 7/24/06, Dr.Ruud <[EMAIL PROTECTED]> wrote:
"Nishi Bhonsle" schreef:
> If I need to get the files without the "." and the ".." at the first
> level only, then how can i modify the find command
Hi:
If I need to get the files without the "." and the ".." at the first level
only, then how can i modify the find command?
ie
Currently using find(sub {push(@new,$_) if ( -f ) }, $path); gives me all
files under NewDir as well as NewSubDirectory
C:\build\Sample\NewDir\File1.txt
C:\build\Sample\
That works like a charm, thanks!
-Nishi.
On 7/21/06, Wagner, David --- Senior Programmer Analyst --- WGO <
[EMAIL PROTECTED]> wrote:
Nishi Bhonsle wrote:
> I tried it but didnt work.
> my @new;
>
> find(sub {push @new, $_}, $path);
find(sub {push(@new,$_) if ( !/^\
file2.txt
How can I not include the "." ?
Thanks!
-Nishi.
On 7/21/06, Rob Dixon <[EMAIL PROTECTED]> wrote:
Nishi Bhonsle wrote:
> Hi:
> I am starting a new thread based of an older thread just because there
> was a
> lot of different things that were requested for and i
Hi:
I am starting a new thread based of an older thread just because there was a
lot of different things that were requested for and it had gotten a bit
confusing.
I got a lot of help from all you experts to write the below code that takes
an argument path C:\build\Sample\NewDir that contains--
-instance";
xsi:noNamespaceSchemaLocation="filemap.xsd">
On 7/12/06, Nishi Bhonsle <[EMAIL PROTECTED]> wrote:
Hi:
Sorry to start this thread again, but it would not have been wise to ask
my related question in a different thread.
I tried to run the prog
Hi:
If I am still using the below logic, how can i modify the below prog
to ignore empty directories and list only directories containing directories
and files in buildlist.txt ?
opendir DIR, $path or die "Can't open $path: $!";
#my @new = grep /[^.]/, readdir DIR;
my @new = grep { $_ ne "." a
Hi:
I want to manipulate strings containing filenames that have the following
format
Web\SiA\web\..\..\ etc
Web\SiAData\web\app\..\..\ etc
to remove everything in the begining of web part of the above strings and
store the rest of the part ie
web\..\..\ into a new string.
Thereafter I will refere
Hi:
I have a filenames such as NQSname_l_cs.txt, NQSname_l_da.txt, NQSname_l_zh-
tw.txt etc.
I would like to modify these filenames such that they are NQSname.txt
What regex i could use to modify these filenames?
Thanks much.
Hi:
If I have to create a writeable file say write.txt on fly during program
execution under the OS default/local drive of a machine ie C:\ or D:\ on
windows and /home/user etc on unix, how can I get that local/default drive
using perl so that I dont have to hardcode C:\ or D:\ or /home etc insid
Hi:
In writing a perl script to read the contents of a directory on a windows
system, i noticed that there are some directory names have spaces in them.
How can I modify the line below so it would ignore the spaces in the
directory name and still process it ?
opendir DIR, $path or die "Can't ope
ntents to the console.
How i can correct this?
Thanks.
On 7/12/06, Chasecreek Systemhouse <[EMAIL PROTECTED]> wrote:
On 7/12/06, Nishi Bhonsle <[EMAIL PROTECTED]> wrote:
> Hi:
>
> I would like to check whether the string [server_bin.files] exists in a
> particular file an
Hi:
I would like to check whether the string [server_bin.files] exists in a
particular file and if it does, then do not add it again.
How can I check for this string using perl regex?
Thanks!
Hi:
Sorry to start this thread again, but it would not have been wise to ask my
related question in a different thread.
I tried to run the program on a windows machine, apparently the regex in
question only lists directories within directories and not the files within
the directories.
I tried Rob'
Yes, thank you. This is it. I was able to manage a similar working version,
your post is much cleaner and easy to follow.
Thanks again
-Nishi.
On 7/9/06, Rob Dixon <[EMAIL PROTECTED]> wrote:
Nishi Bhonsle wrote:
>
> Thanks for all your suggestions and help. I was able to do t
Hi:
Thanks for all your suggestions and help. I was able to do the following --
1)Flatten out the directory structure into a file containing the dir and
files within the dir into
C:\buildlist.txt
2)Read the lines from a file say files2.txt and modify the lines to contain
the filenames fetched int
ow how to read the line in the below file, look for
the second and forth " and write the name of the file fetched in the
above program before the second and fourth " and between the fifth and sixth
" one by one.
"SL/" "%HOME%/server/bin/" "" NA
as in
&q
Hi:
Can you please help me write a perl script that takes the files from a
directory and spits out the filenames into a file.
say.
I have a file structure on a file system such as
C:\Temp\one
C:\Temp\two
C:\Temp\one\oneone
C:\Temp\one\onetwo
C:\Temp\one\onethree
The original file contains lines
Hi:
I have the following script that takes in an input file, output file and
replaces the string in the input file with some other string and writes out
the output file.
I want to change the script to traverse through a directory of files
ie instead of prompting for input and output files, the sc
28 matches
Mail list logo