How to delete new-line symbol - text

When I copy a text in PDF file and paste it into Notepad or MS Word, then it looks like this:
This is an
example
of the
issue.
Original text looks as follows:
This is an example of the issue.
Is there any automated way to copy this text as a single line, without new lines?

In Word do cmd+f. then : put ^11in "find what" and (space) in "replace".
hit enter.

I solved this issue in MS Word: replace ^p with (space).

Related

how to end a line with semicolon (;) in a csv format with excel?

i am trying to save a file to csv format in excel but the results appears like this when i open it in notebook:
04/13/2020;20:00;8699;8745;8686;8742;5925
i need each line ending with a semicolon (;) like this
04/13/2020;20:00;8699;8745;8686;8742;5925;
i tried Spliting text into different columns with the Convert Text to Columns Wizard and selecting delimited to separate with semicolon , but i cannot find a way yet.
how can i convert this?,
Try this on Windows/Notepad++ :
Open your .csv file
Press CTRL+A to select all the lines
Press CTRL+H (Replace)
Select Regular Expression in Search Mode
Tap $ (which means the end of each line) in Find what
Tap ; in Replace with
Click Replace All
The ; will be then interpreted as delimiter in Excel (see column8 in the image below):

What is the character code for new line break in excel

I tried char(10) and char(13) but they don`t work by me. I use Excel 2007 and my task is to replace new lines with intervals
Use CHAR(10) and Turn on Wrap Text option. It should work.
Try using the [Alt] + [Enter] key. This will create a new line feed in the cell.

Carriage Return in Notepad

I have between 1-2 thousand notepad files that I need to add a new line to. I have an excel macro that can automatically find and replace text in notepad files, which I can use to add in the text I need. The excel macro has one cell where the user types the text to be found, and another where the user types the text that will replace that text. The problem is, I need to replace one line with two, and putting in a linebreak in the 'replace with' cell in excel (using alt-enter) does not put the text on a new line in notepad.
Interestingly, when I open the notepad file in Word, it does show up on a new line, with a carriage return between the two lines, but is still on the same line in notepad. Is there any way that I can use the excel macro to add the carriage return to show up in notepad?
ALT+Enter will only put a line feed into the string.
Notepad does not understand the "UNIX" style of encoding, but more advanced programs do.
if you replace the line feed with a full DOS newline, you should find your problem goes away:
NewString=Replace(OldString,vbLf,vbCrLf)
vbLf is the excel constant for the line feed.
vbCrLf is the excel constant for the DOS newline.

Viewing a txt file with row separator "\x00"

I got a program that outputs a txt with column separator "\t" and row separator "\x00" (hex code)
But when I open the txt with MS Excel, Notepad++, LibreOffice, all the contents are put in one row.
But I want to open this in either MS Excel or LibreOffice in the "normal" view so that I can edit it easily.
I tried to find some type of buttons in LibreOffice to change the separator but I couldn't.
I changed encoding of it using Notepad++ to all encodings, but changing encoding didn't help at least at notepad++.
How can I open this file with row separator actually being displayed as it should?
I want to see this in multiple rows and edit it efficiently.
In Notepad++, you can perform a Find and Replace (ctrl+h).
Set the Search Mode to Extended
For the Find what, enter \\x00
For the Replace with, enter \n
Hit Replace All
Then to replace the \t with tabs, you can:
For the Find what, enter \\t
For the Replace with, enter \t
Hit Replace All

How to copy a word and paste it over another word in Vim?

I know how to copy a word, but I seem to overwrite what is in my clipboard because, when I try to copy over a word, it does not seem to be working.
To copy a word, I can use
bye
How to copy over a word?
Perhaps you just want to do this:
viwp
which will visually select a new word, and paste over it.
Now, if you don't want to lose your register when doing this, you can also put in your vimrc:
xnoremap p pgvy
Copy the source word as usual (e.g., with yiw) and use
viw"0p
to paste over the destination word.
Since the p command in Visual mode (see :help v_p) does not alter
the numbered register 0 containing the text from the most recent
yank command, the same copied word can be pasted over and over again.
Do this once:
ciw<C-r>0
Then to replace words always using the text you yanked do:
.
You can use search with it like this:
/foo<Cr>
.n.n.n
It works because:
ciw replaces inner word and
<C-r>0 uses the most recently yanked register to replace it, which . then also uses.
Sadly, this does not work if you visually select text you wish to replace and use ..
Note that if you originally used visual selection to select the text to replace and did c<C-r>0 then after that . will replace the same length of characters as was included in the visual selection.
When you delete a word it is put in the " register which is the default register for pasting, so when you delete the word you want to replace, it will take the previous word's place in the " register. However, the previous word will be in register 0, the one before in 1 and so on – you can at any time see this by running :reg and see the registers' contents. So, to replace a word you can first copy the first word (yiw), then “change” the word you want to replace (ciw) and then insert from register 0 by hitting ctrl-r, 0. (You could also first delete the word (diw) and then paste from register 0: "0p.
The easy solution is to do it the other way around: first paste the new word, then delete the old one.
You could use register 0, which contains the just-overwritten "clipboard" text. For your example, you could yank the text to paste, put the cursor somewhere in the word "bye", and type
ciw [cut in word; deletes the word under the cursor and goes to insert mode there]
ctrl-r 0 [register 0; paste text from register 0]
You can see what's in all the registers with :disp. As Daenyth says, you can yank into a particular register with "x[del/cut/yank command] and paste with "xp from command mode, or ctrl-r x from insert / replace.
You can yank into a register by prepending it with "a (where a is the name of the register). See How to use vim registers
b"aye

Resources