Page 1 of 1

On copy I get a "\n" after file path. How to fix?

Posted: 2015-10-08, 07:47 UTC
by B@ron
Hi.

i use button to copy path file and get a "\n" after path file, can you fix it? This creates problems when using terminal emulators - connect bot, better terminal emulator, etc

Posted: 2015-10-08, 09:21 UTC
by ghisler(Author)
Hmm, there is no such command. Or do you mean "121 Copy names to clipboard"? This is for copying selected file names.

Posted: 2015-10-08, 09:37 UTC
by B@ron
ghisler(Author) wrote:Hmm, there is no such command. Or do you mean "121 Copy names to clipboard"? This is for copying selected file names.
no, 122

i copy paths + filenames, after last string inserted "\n" (newline) :(

Posted: 2015-10-08, 10:00 UTC
by ghisler(Author)
I see - all names are indeed separated by line breaks. It's debatable whether there should be a break after the last line or not...

Posted: 2015-10-08, 10:16 UTC
by B@ron
ghisler(Author) wrote:I see - all names are indeed separated by line breaks. It's debatable whether there should be a break after the last line or not...
After a single line - no :) after many lines - may be needed

Posted: 2017-08-13, 16:44 UTC
by DrShark
B@ron wrote:
ghisler(Author) wrote:I see - all names are indeed separated by line breaks. It's debatable whether there should be a break after the last line or not...
After a single line - no :) after many lines - may be needed
I agree. If one file or folder name copied with one of TC4A copy names commands, TC4A should't add \n because this extra character must be removed then manually each time when pasting it into a New text file or New folder dialog.

Re: On copy I get a "\n" after file path. How to fix?

Posted: 2021-08-01, 18:15 UTC
by B@ron
This issue is still relevant. Adding a newline when copying a single full file path creates problems. Can you fix this ? Maybe an additional setting in the options ?

Re: On copy I get a "\n" after file path. How to fix?

Posted: 2021-08-02, 15:54 UTC
by ghisler(Author)
Should I remove the \n at the end just when there is one file, or always?

Re: On copy I get a "\n" after file path. How to fix?

Posted: 2021-08-03, 16:07 UTC
by Usher
2ghisler(Author)
Remove \n only for a single line. In other cases some programs may ignore the last line if it's not ended with proper EOL mark (treat incomplete line as unfinished command, broken transmission etc.)

Re: On copy I get a "\n" after file path. How to fix?

Posted: 2021-08-03, 16:42 UTC
by Stefan2
ghisler(Author) wrote: 2021-08-02, 15:54 UTC Should I remove the \n at the end just when there is one file, or always?
Me think "always", if there is one line only or is it the last line of many lines.






 

Re: On copy I get a "\n" after file path. How to fix?

Posted: 2021-08-04, 10:26 UTC
by ghisler(Author)
some programs may ignore the last line if it's not ended with proper EOL mark
You have a valid point here, so I will do that.
Hopefully they will not ignore single files then...

Re: On copy I get a "\n" after file path. How to fix?

Posted: 2021-08-06, 17:56 UTC
by B@ron
ghisler(Author) wrote: 2021-08-02, 15:54 UTC Should I remove the \n at the end just when there is one file, or always?
I apologize for the delay in answering, I did not receive a notification in the mail. Yes, you need to remove it only when copying the name or full path of a single file (functions 121 Copy Names to Clipboard and 122 Full Names to Clipboard).

A new line after the path when using the copied path in the terminal executes the file, which can cause problems.

When using the file name for the rename, the new line symbol has to be removed because it is written to the filename (on internal storage) :

Code: Select all

ls '/storage/sdcard1/Download/'|grep IMG_20210806_132015.jpg|od -c
0000000    I   M   G   _   2   0   2   1   0   8   0   6   _   1   3   2
0000020    0   1   5   .   j   p   g   ?  \n
"?" a newline character in the file name