10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a directory like below. Need help with Perl to delete all files under test1 except the one passed as parameters.The parameters will
always be the directories under test1 in the format below.
EX:
dir1/abc.txt,dir2/test.xml,dir3/dfb.txt,dir4/text.xml
test1
... (5 Replies)
Discussion started by: gaurav99
5 Replies
2. Shell Programming and Scripting
Dear All,
could you please help me to remove \n characters after all other replacements have been done as in the code below:
{
#remove punctuation and starting whitespaces
gsub("]"," ");
$1=$1;
}
{
#print lines containing 'whatever'
if ($1=="whatever")
{print}
#print... (3 Replies)
Discussion started by: shivacoder
3 Replies
3. Shell Programming and Scripting
Hi all,
I need a Perl one liner which prints a newline into a .txt file, only where the line starts with "/mediawiki-1.19.0/". It should add the newline to the line before.
My problem is, when I try to realize this (with my little knowledge :rolleyes: ) i come to the point where the // are... (4 Replies)
Discussion started by: Mr.Smith
4 Replies
4. Shell Programming and Scripting
im having an array @check which contains text ..i want to open the array and i have to delete lines starting from a word called "check1" till "check2"
for eg:-
check1 Use descriptive titles when posting. For example, do not post questions with subjects like "Help Me!", "Urgent!!" or "Doubt".... (0 Replies)
Discussion started by: rajkrishna89
0 Replies
5. Shell Programming and Scripting
Hello All
I am implementing my task in Perl and i found an issue.
What i want to do is to remove files from the directory which were made 20 days back using Perl script (9 Replies)
Discussion started by: parthmittal2007
9 Replies
6. Shell Programming and Scripting
Hi,
How to delete a file (if exists) using perl script.
I have used following script..
if ( -e $newfile) {
open (FILE, ">$newfile") || die "Cannot Open File\n";
print FILE;
close(FILE);
}
But it gives me error "Use of uninitialized value in print".
please help.
Thanks in... (1 Reply)
Discussion started by: arup1980
1 Replies
7. Shell Programming and Scripting
How to delete last row in the file in PERL.
file1 has
a.output
b.output
c.output
d.output
e.output
expected output is
a.output
b.output
c.output
d.output (1 Reply)
Discussion started by: adaleru
1 Replies
8. UNIX for Dummies Questions & Answers
i want to delete the line which is not started with numeric in vim.
vim temp.txt
Volume in drive D is DATA
Volume Serial Number is 8C52-2055
Directory of D:\data\notes
02/16/2010 03:09 PM <DIR> .
02/16/2010 03:09 PM <DIR> ..
09/11/1999 03:03 AM ... (5 Replies)
Discussion started by: Manabhanjan
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I have learned some of the Unix commands a way back and not sure of how to code them when needed in certain way, especially sed command. Here is my situation. I have an xml file with several tags. most of the tags start on the same line and end on the same line. However, data for some tags... (8 Replies)
Discussion started by: girish312
8 Replies
10. Shell Programming and Scripting
Probably I am not seeing it or I am not using the "delete" correctly I had the following codes but it does not work for me
#!/bin/perl -w
...
@sysFile1 = (a_b, a_c, a_d);
@sysFile2 = (a_c, a_e, b_f);
foreach $line1 (@sysFile1){
trim(\$line1);
(my $tmp1, my $tmp2) = split/_/,... (6 Replies)
Discussion started by: ahtat99
6 Replies