Jump to content

[Solved] Removing newline in clipboard


Recommended Posts

Hi. Looking for a simple workflow to stripe off first line of text in clipboard, replaces string "These are the value" with "" (blank). How do I remove newline as well in 1st line? Effecting deleting entire 1st line? Tried "These are the value\n" but didn't work. 

 

Example of text in clipboard

   These are the value

   ABC

   DEF

   GHI

 

image.jpeg.f266efa6db5c758c3ddde319200219b0.jpeg

Edited by iApple
Link to comment
44 minutes ago, giovanni said:

you could add a 'Run Script' object with this command (in bash/zsh):

pbpaste | tail -n +2 | pbcopy

Thanks for suggesting. Googled command line and that's display last 2 lines, but number of lines in clipboard varies all the time. Is there a way to just to delete the 1st line or pipe all lines expect first line to pbcopy? Only found "wc -l" but that looks to be cumbersome solution.

Link to comment

there's a plus before 2. 

Tail command also comes with an ‘+’ option which is not present in the head command. With this option tail command prints the data starting from specified line number of the file instead of end. For command: tail +n file_name, data will start printing from line number ‘n’ till the end of the file specified.

Link to comment
2 minutes ago, giovanni said:

there's a plus before 2. 

Tail command also comes with an ‘+’ option which is not present in the head command. With this option tail command prints the data starting from specified line number of the file instead of end. For command: tail +n file_name, data will start printing from line number ‘n’ till the end of the file specified.

Thanks! Explanation helps. 

Link to comment
  • iApple changed the title to [Solved] Removing newline in clipboard

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...