Help appending comments on files!
-
Wanda
- Posts: 55
- Joined: 08 Jan 2011 01:08
Help appending comments on files!
Hi. I need to append or prepend(?), sometimes one, sometimes the other, a few comments or signatures on batches of those text (.txt) files. I have found some apps able to do this but then they change every file marking them as modified today and this is not allowed as the modification dates are to be left untouched until they are updated in their core content. I'm wondering if anyone can help me on this?
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: Help appending comments on files!
So you're wanting to modify the contents of the files without affecting the modification date? Seems like a bit of a conflict there...not sure how XY might help there...maybe via scripting it could be done but I'm not the expert on that.
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
admin
- Site Admin
- Posts: 66362
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Help appending comments on files!
You are aware that XY has a whole suite of commenting features? XY is THE file manager for commenting or tagging files. Please check the Help file...
FAQ | XY News RSS | XY X
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: Help appending comments on files!
The way I read it, OP was wanting to add some text to contents, like a std signature block with disclosure info or such...we'll have to wait for OP to clarify which it is.admin wrote:You are aware that XY has a whole suite of commenting features? XY is THE file manager for commenting or tagging files. Please check the Help file...
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
Wanda
- Posts: 55
- Joined: 08 Jan 2011 01:08
Re: Help appending comments on files!
Yes signature blocks on some of those files or general comments on others. My brother and a friend already tried the scripting beforehand but failed on this
-
Stefan
- Posts: 1360
- Joined: 18 Nov 2008 21:47
- Location: Europe
Re: Help appending comments on files!
I don't can understand what you really want
but as far as i understood the following demo script could be an first step?
but as far as i understood the following demo script could be an first step?
Code: Select all
//Modify the file content by adding some text, then set back the original modified date time stamp.
//WARNING: be sure to modify only plain TEXT files, no binaries, no Word doc or like that!
//Test this script first on copies of your real important files!
//File to work on:
$CurrFile = "<curitem>";
//Get the current modified date:
$CurrModDate = report("{Modified}",1);
//Read the file content:
$CurrContent = readfile($CurrFile);
//Prompt for text to add:
$ContentToAdd = input("Text to add");
//Compose new content:
$NewContent = $ContentToAdd . "<crlf>" . $CurrContent;
//Write file back with modified content:
writefile($CurrFile, $NewContent);
//Set back original mod date:
timestamp m, $CurrModDate, $CurrFile;
msg "Done",1;
-
j_c_hallgren
- XY Blog Master
- Posts: 5826
- Joined: 02 Jan 2006 19:34
- Location: So. Chatham MA/Clearwater FL
- Contact:
Re: Help appending comments on files!
Once again, our great scripter (and helper) Stefan comes thru with a well-commented sample that likely solves the problem or comes close!Stefan wrote:I don't can understand what you really want
but as far as i understood the following demo script could be an first step?
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.
-
Wanda
- Posts: 55
- Joined: 08 Jan 2011 01:08
Re: Help appending comments on files!
thank you very much!
XYplorer Beta Club