Sorry MoshiachNow - I misunderstood you
How' this (it's too early for me to check it carefully - but I think it's o.k.)
#!/usr/bin/perl
while (<DATA>) {
chomp;
print "$_\n" unless $_ =~ /\.(txt|nfo|log|zip)$/ ^ $_ eq 'UserAccounts.txt';
}
__DATA__
dummyfiletofind.file
ignore_me.nfo...
say, for example, I have a text file that reads:-
Fred Bloggs
123 Example Street
Fred Bloggs
123 Example Street
Would it be possible to delete one of the entries?
It works!!!
I have no idea how though!
Could you please explain briefly how the program works as I do not know how to replace your example for mine in my program.
Why does the substitution work in your program but not in my example? Even if I copy your substitute line out of your program into...
Hi Lee
I am afraid I am a novice with Perl but this does do what you need - albeit a bit messy as it will cut words up - I will try to work on one that will not
open (INFILE, 'sixtyfour.txt');
$file = <INFILE>;
for ($position = 0; $position < length($file); $position +=64) {
print...
Hi Tracy
Thanks again for your reply
This is the relevant code copied & pasted from my program...
open(INFILE, 'file.txt')
while (<INFILE>) {
$cell =~ s/\Q(*)\E/\Q<z9b15>(*)<z$b$>\E/g;
}
I have placed the \Q...\E codes around the substitute FROM/TO values as you suggested but I am afraid no...
Dear Tracy
Many thanks for your reply - I am very grateful for your help
Unfortunately I am getting the following result using your regexp
\\(\*\)
Does this make any sense?
Kind Regards
Duncan
This should work:-
print "Set-Cookie: Information=$Information; expires=Thu, 31-Dec-1998 00:00:00 GMT\n";
obviously the date is just an example of the required syntax
Good Luck
Duncan
Thank you for your response -
That is exactly what I need to achieve - they are control codes for QuarkXpress that I need to wrap around the (*) to adjust its size - just in case you were interested!
Hope you can be of help...
Cheers
Duncan
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.