Hi,
I would like to open and read a file that is in this format:
Time|Username|Email|IP
for example:
1345289299|Test|stinesofe@changesmile.org.ua|82.45.104.76
After reading a form input that includes $username and $ip, if the Email or IP are not listed in the file, then I would like to add...
start dat editing
directory is ./Members
files to process are ./Members/1.dat./Members/2.dat./Members/3.dat./Members/4.dat
start file ./Members/1.dat
write temp file /tmp/08yw9L8QjX
rename file /tmp/08yw9L8QjX to ./Members/1.dat
0rename error Invalid cross-device link
end file ./Members/1.dat...
My mistake, it's not deleting any of the lines, it just reorderd them.
Here's what I now get:
start dat editing
directory is ./Members
files to process are ./Members/1.dat./Members/2.dat./Members/3.dat./Members/4.dat./Members/5.dat
start file ./Members/1.dat
write temp file /tmp/nKijKk93AQ...
It looks like it is functioning but it doesn't actually delete the lines siteurl and sitename.
start dat editing
directory is ./Members
files to process are ./Members/1.dat./Members/2.dat./Members/3.dat./Members/4.dat./Members/5.dat
start file ./Members/1.dat
write temp file /tmp/WFTaSsK1ga...
Thanks for your patience.
This is the code and nothing happens:
#!/usr/bin/perl
use CGI::Carp fatalsToBrowser;
# Global information:
$theblahver = 16;
$version = $versioncr = '10.3.6'; # Said Version; Copyright version
$blanktarget = " target='_new'";
# Uncomment this for better time...
Sorry but no joy.
I did change this:
foreach $file (<*.dat>) {
to this:
foreach $file (<$members/*.dat>) {
as this is the folder the .dat files are in.
I pasted it at the top of another script and when run it just gives a HTTP 500 error.
I think I will need something more on the lines of:
open(FILE,"$members/$_.dat");
while(<FILE>) {
code
code
code
close(FILE);
}
or something along those lines.
Sorry for being so vague.
Thanks for the reply but that just gives a 500 error
What I need is a small script that when run will:
open each .dat file in the Members folder
Read each line
If siteurl or sitename exists either delete the line or set it to ''
Hi,
I have a folder with a list of files - 1.dat, 2.dat, 3.dat etc
The file structure is:
rndsid = |11026|1342296563|
lastactive = |1342296563|
lastvisit = |1340862364|
sitename = |Free PC Help|
email = |admin@mysite.com|
pmpopup = |1|
lastpost = |1340736611|
password = |******|
posts = |2|...
Thank you for being so prompt.
Can I explain that $messid is a message id and changes with each message. The variable must be similar on this forum it is probably $qid, in the address bar it says qid=1685298 for this post.
The file $username.temp is not being created when a member accesses the...
Thanks for the reply I am a novice at perl programming that is why I am here seeking help, my attempt is more than likely useless.
The file I am reading is called $username.term and has this layout:
1339142221
1339142970
1339143224
etc
I wish to read from the top of the file and see if any of...
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.