10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
In the given file, what I need to do is to select double (or triple) occurring files and delete the one having smaller file size. And would like to keep the one with the big file size.
518t-rw-r--r-- 1 emily us_cms 101348458 Oct 8 16:43 vgtree_518_0_LHB.root
518t-rw-r--r-- 1... (9 Replies)
Discussion started by: emily
9 Replies
2. Shell Programming and Scripting
When I use special characters the command to replace multiple files with a string pattern does nt work.
---------- Post updated at 12:33 PM ---------- Previous update was at 11:38 AM ----------
This works
perl -pi -e 's/100/test/g' *
This does nt work
perl -pi -e 's... (1 Reply)
Discussion started by: w020637
1 Replies
3. UNIX for Dummies Questions & Answers
I'm attempting to use grep in Perl with very little success.
What I would like to do in Perl is get the output of the following grep code:
grep -l 'pattern' *
This gives me a list of all the files in a directory that contain the pattern that was searched.
My attempts to do this in Perl... (4 Replies)
Discussion started by: WongSifu
4 Replies
4. Shell Programming and Scripting
I have a script that runs on one file (at a time).
like this:
$> perl myscript.pl filename > output
How can I run it on >6000 files and have the output sent out into slightly modified file name
$> perl myscript 6000files> output6000files.new extension
Thanks in anticipation (4 Replies)
Discussion started by: aritakum
4 Replies
5. Shell Programming and Scripting
Dear All,
I am looking for an option in perl using which i could delete empty lines in a file.
Or
the alternative of sed '/^$/d' <filename> in perl. Sed is not working in my perl script :(
Pls help me out .
Thanks,
VG (4 Replies)
Discussion started by: vguleria
4 Replies
6. UNIX for Dummies Questions & Answers
Hi all,
I know the one liner to delete all the lines in a file which matches a pattern
i.e
perl -i.old -ne 'print unless /pattern/' file
Now i need the perl onliner to delete all the lines which doesnt match the pattern. Also what is the difference between perl -i and perl -i.old.
Does... (1 Reply)
Discussion started by: lijju.mathew
1 Replies
7. Shell Programming and Scripting
Hi,
I need to generate a test data file by reading inputs from multiple files.
A sample pseudo code for this program to read from three files and write to a output file would be like:
open(OUTPUTFILE, "data");
open(INFILE1, "data1");
open(INFILE2, "data2");
open(INFILE3, "data3");
... (1 Reply)
Discussion started by: jyotipg
1 Replies
8. Shell Programming and Scripting
Hi,
I have a list of directories which contain old files that are to be deleted.
I put the list of all directories in a txt file and it is being read by a script
Iam searching for the files older than 60 days using mtime and then deleting it
But all the files are getting deleted... (3 Replies)
Discussion started by: Chidvilas
3 Replies
9. Shell Programming and Scripting
All,
I want to combine multiple files in one file.
Something like what we do on the commad line as follows ->
cat file1 file2 file3 > Main_File.
Can something like this be done in a perl script very efficiently?
Thanks,
Rahul. (1 Reply)
Discussion started by: rahulrathod
1 Replies
10. Shell Programming and Scripting
Hello, i need some help with a perl script.
i need to add the lines:
#ifdef LOGALLOC
#include "logalloc.h"
#endif // LOGALLOC
To all c and h files in a project with subdirectories.
Logalloc is a tool to log all *alloc and free's in a text file, it defines the *alloc funtions new.... (2 Replies)
Discussion started by: Lazzar
2 Replies