Rename file with first line of file

Javascript renaming examples. Javascript renaming is supported in version 3 or newer.

Rename file with first line of file

Postby Elender » Sat Dec 05, 2020 2:24 pm

Is it possible?

For example the first line of file contains a sentence wich uses all type of characters, even invalid ones like \ / : * ? " < > | which should be ignored.
Elender
 
Posts: 2
Joined: Sat Dec 05, 2020 2:06 pm

Re: Rename file with first line of file

Postby Elender » Sat Dec 05, 2020 2:27 pm

For more details: I'm talking about txt files.
Elender
 
Posts: 2
Joined: Sat Dec 05, 2020 2:06 pm

Re: Rename file with first line of file

Postby Luuk » Sun Dec 06, 2020 11:42 pm

Greetings Elender.
Im not can do this in javascript, but thinking certainly its to be possible, since the exiftool does this with perl. The perl has readpipe() function, so maybe the javascript has related function() to conduct in similar design? If its not to be illegal, I can post exiftool solution, but not if the javascript already does this.
Luuk
 
Posts: 335
Joined: Fri Feb 21, 2020 10:58 pm


Return to Javascript Renaming