Questions tagged [text-editing]
Text editing is the process of selecting and preparing text [files].
511
questions
216
votes
5
answers
44k
views
How do you reuse a visual mode selection?
Often when editing code, I'll select a block in visual mode and do a search and replace over the block. After I make the changes, however, it leaves visual mode. How do you do a new find and replace ...
147
votes
6
answers
42k
views
How do I reverse selected lines order in Vim?
For example, if I have four lines as follows:
the first line
the second line
the third line
the fourth line
I want to reverse them to
the fourth line
the third line
the second ...
133
votes
4
answers
256k
views
Replace \r\n with newline in Notepad++
How do I replace the string "\r\n" with the same characters?
Example:
Hello World.\r\nHello World.
replaced with:
Hello World.
Hello World.
130
votes
18
answers
54k
views
Substitution in text file **without** regular expressions
I need to substitute some text inside a text file with a replacement. Usually I would do something like
sed -i 's/text/replacement/g' path/to/the/file
The problem is that both text and replacement ...
119
votes
5
answers
937k
views
How to write multi lines in one Excel cell?
I want to write multi-lines in one MS Excel cell.
But whenever I press the Enter key, the cell editing ends and the cursor moves to next cell. How can I avoid this?
100
votes
10
answers
499k
views
How can I split a large file on Windows?
Is there a tool to split large text file (9 GB) into smaller files, so that I can open it and look through?
Is there anything usable from the command line that comes with Windows (XP)?
Or what's the ...
86
votes
4
answers
82k
views
How can I filter a file for lines containing a string in Sublime Text 2?
I want to filter a file I'm editing in Sublime Text 2 for lines contain a certain string, if possible including regular expressions.
Consider the following file:
foo bar
baz
qux
quuux baz
When ...
66
votes
8
answers
44k
views
emacs: how to indent/unindent region of python code by 4 spaces?
I have a region of python code selected in emacs. What are the most efficient ways to indent and unindent every line in it by 4 spaces?
Ideally I'd like something that's not context sensitive (eg. it'...
66
votes
10
answers
155k
views
How can I edit a file if there is no vi, vim, joe, etc?
Is there a way to edit a file if there are no vi, vim, joe, mcedit? In another words is there a way to edit a file using just the shell commands?
65
votes
4
answers
66k
views
How to make cut/copy/paste in GVim on Ubuntu work with Ctrl+X,Ctrl+C,Ctrl+V?
By default, the cut/copy/paste short-cuts in GVim on Ubuntu are:
Cut "+x
Copy "+y
Paste "+gP
I would like to use control key combos in GVim, like I use in Firefox and othe gnome ...
63
votes
5
answers
66k
views
Ctrl+Backspace inserts a small box instead of erasing
When I press Ctrl+Backspace, sometimes a small square is inserted, instead of the entire word being erased.
The problem only happens in some text boxes; in others the shortcut works like it should.
...
61
votes
3
answers
18k
views
Why does the same data take more space in a text file than in an Excel file?
I have around 100000 rows of data. If I store this data in a text file format, it takes more space than if I store it in an Excel file format. Why is that?
59
votes
6
answers
250k
views
What is the closest thing to Windows notepad on the Mac? [closed]
What is the closest thing to Windows notepad on the Mac?
I'm using Leopard.
53
votes
5
answers
195k
views
Notepad++ inserting special Unicode characters in UTF-8
What's the best ways to enter special Unicode characters into a Notepad++ document? Do I have to rely on the operating system (Windows)?
Looking for a see-and-click solution.
I can bring up the ASCII ...
48
votes
3
answers
19k
views
Turn Off Parenthesis Matching in Sublime Text 2
I have questions about turn off parenthesis matching. Does anyone know how to turn off parenthesis matching?
example:
When I type a (, it will automatically add ), becomes ().
It's pretty nice for ...
46
votes
14
answers
102k
views
Convert Unix line endings to Windows
I recently moved back to Windows from Linux. I have some files with CRLFs, some with LFs and some that are mixed. Is there a utility that will help me find all my Unix-touched files and convert them ...
41
votes
4
answers
69k
views
Converting CSV to fixed-width in Notepad++?
Is there a way in Notepad++ to convert a comma-separated file to fixed width columns?
This feature exists in UltraEdit and explained in Working with CSV files, but I am happy with my Notepad++, and I ...
36
votes
3
answers
17k
views
In Sublime Text 2, how can I indent out to a straight column with multiple cursors on a ragged edge?
Suppose I've got multiple cursors along several lines, like this:
foo|
barr|
foobar|
baz|
How can I automatically push the whitespace at the end of each line out to a flat edge, like this?:
foo |...
35
votes
3
answers
8k
views
Edit one file in two different buffers in emacs
I would like to open the file foo.bar twice (or more) in emacs, so I can edit two different parts of it simultaneously. Is it possible? Probably the better question is, how to do it? Is there a way to ...
33
votes
7
answers
181k
views
How can I edit Unicode text in Notepad++?
Sometimes I edit English text that includes Unicode characters. For some reason, on my PC, Notepad++ converts Unicode characters to ???'s thereby corrupting the text and losing all that data. I'm ...
32
votes
2
answers
103k
views
How to change the text direction on Windows?
Sometimes when I'm typing, text orientation changes from LTR to RTL, but I am not able to find any shortcut to change the text direction on Windows.
How can I change the text direction inside a text ...
29
votes
10
answers
92k
views
Can you edit the contents of an Excel cell without having to double click it?
I have a list of about 10,000 name/addresses that I have to manually cleanse in Excel (fun!). As you can imagine, having to double click to enter almost every cell to edit it is a drag. And it's ...
27
votes
1
answer
50k
views
What does `-n` option in sed do?
This is the man page entry for -n:
-n
suppress automatic printing of pattern space
I notice that when not using -n for certain operations, each line is printed to stdout (and the requested ...
25
votes
8
answers
117k
views
Find and Replace several several different values all at once
I have a file with multiple instances of Text_1 and Text1 and I need to replace both those strings with Text_A and TextB respectively.
Currently I'm doing two Find and Replace functions on each ...
24
votes
13
answers
13k
views
Best LaTeX Editor [closed]
What's the best LaTeX editor you've used, and what would you recommend someone read to understand and become proficient with authoring papers/books in LaTeX?
23
votes
8
answers
13k
views
How can I justify plain text in Linux?
I'm composing a plain text (.txt) document that has left-and-right justified paragraphs. I manually add spaces, breaking words with hyphens if necessary, until the lines are uniform length. To use an ...
20
votes
4
answers
33k
views
How to paste Excel data as fixed-width text?
If I copy data in Excel and paste it in a text file, I get tabs between cells. That's not good, I want spaces - and I want the columns to be aligned. How can I achieve this without a lot of effort (...
18
votes
6
answers
165k
views
How Can I Type A Checkmark (✓) Via Alt Code?
Presently, every time I want to check something off I have to Google "checkmark", copy the symbol from a 3rd party website, paste it into a text editor to remove formatting, and then copy ...
18
votes
4
answers
12k
views
Show/Hide function folding margin on Notepad++
Is it possible to get rid of the function folding margin on Notepad++? It seems like the sort of thing that should be in the prefs but I'm not seeing it anywhere.
17
votes
5
answers
90k
views
Is there any useful style of MS Word for code?
I need to use MS Word to make some documentation for Python code.
Line number, or boxing around the code, or anything would be better than just use normal format.
Is there any good/useful style/method ...
16
votes
5
answers
6k
views
Match and delete in Notepad++
I have the following text in Notepad++.
192.168.0.1 37 ms N/A
192.168.0.2 Dead N/S
192.168.0.3 ...
15
votes
8
answers
25k
views
Notepad++ - Removing the first column in a comma separated file
I have a large CSV file that I need to remove the first column of data. I cannot open it in Excel because Excel converts some of the values in the columns to scientific numbers.
I am using Notepad++, ...
15
votes
4
answers
4k
views
What is a CUA editor?
A term I hear now and then is a "CUA" text editor.
What is a CUA editor?
15
votes
2
answers
16k
views
Is it possible to view two files simultaneously in Geany?
I tend to be a simple text editor user, but when I want IDE-like features, I've been using Geany. One thing I find bothersome about it, though, is I can see only one file at a time. Sometimes I want ...
14
votes
10
answers
7k
views
Are there shortcuts for text editors/processors to delete the rest of a line?
The cursor may stay in the middle of the line and there may be necessity to delete whatever stands from the right side of the cursor, but only till the end of current line. I don't know how this ...
14
votes
4
answers
37k
views
Selecting range of lines in Notepad ++
How do I select specific range of lines in Notepad++ quickly? I have a text file that has over 1M of lines and I need to delete some fragments from it, but selecting lines manually just takes too much ...
13
votes
13
answers
2k
views
What Vim features do you use? [closed]
I spend almost all day programming in Vim and I am sure that a lot of you do too. What features do you use that make your day to day coding that much better? One that I use
is gv, which will let ...
13
votes
5
answers
11k
views
Ubuntu vi Acting Strange
I just installed Ubuntu Server 8 and found vi to be acting strangely (compared to vi on Fedora, CentOS and OSX).
When I use the 'a' command to enter text, pressing the arrow keys results in "C", "D", ...
13
votes
6
answers
22k
views
Randomly shuffle rows in a large text file
I have a text file of ~1GB with about 6k rows (each row is very long) and I need to randomly shuffle its rows. Is it possible? Possibly with awk?
13
votes
5
answers
24k
views
Text / log editor with auto-refresh support [closed]
I'm looking for a text editor / log manager of some kind that will automatically refresh a file's contents when it changes.
I have a single target log file (e.g. current.log) that is overwritten ...
13
votes
2
answers
14k
views
How to select non contiguous lines of code in Notepad++?
What key enables the selection of non-consecutive lines in Notepad++?
I have some Matlab code I have edited with Notepad++. I would like to select distinct (non consecutive) blocks of code in order to ...
12
votes
5
answers
8k
views
How do I delete the next line in vim?
In emacs, whenever I want to delete a few lines of text, I just use C-k until all the text is gone. However, in vim it seems a bit more complex. I know I can do d$ to delete until the end of the ...
12
votes
5
answers
11k
views
Where's my Open-With gVim context menu option in Windows 7?
I have gVim installed. Under Vista and XP, this offered me an addition to either the object context menu of "Edit with gVim", or an addtion to the "Open With" context menu of "gVim". This would let ...
12
votes
4
answers
3k
views
Delete the word in which the text cursor is
When typing/editing text, how do I delete the word at which the text cursor currently is?
I mean a "system-wide" solution that works in most programs (and is maybe offered by the OS), rather ...
12
votes
3
answers
7k
views
Beyond-compare wont ignore line-breaks?
I have this comparison :
I want those line to be treated equal.
but it showes me they are different.
I already applied those settings :
What am I doing wrong ?
11
votes
6
answers
11k
views
Converting tabs to spaces in many files
I have a lot of files with tabs littered throughout, and I'd like to convert them all into spaces. I know about the expand command, but unfortunately I would have to type out every single file using ...
11
votes
2
answers
19k
views
Replace text when in visual-block mode
Maybe I'm searching the wrong way, but I've failed to find out how to do this.
Here's the scenario: I have a list in a text file where I want to insert the same word on multiple lines, here's an ...
10
votes
6
answers
25k
views
What is a good, simple and free HTML editor for Windows? [closed]
Are there any good, simple and free HTML editors for Windows out there?
Something that a user with no experience can build a simple page with.
I'm looking for something like the old FrontPage ...
9
votes
6
answers
10k
views
Free tool for graphical representations of XML files [closed]
I need a tool which displays an XML file in a nice way.
With "nice way" I mean a way on which I can fold and unfold all the nodes.
Is there any free tool that runs on Windows Vista that does this ...
9
votes
1
answer
7k
views
MobaXterm is there a way to disable copy on select?
I am using SSH in MobaXterm, is there a way to prevent automatic "copy" when you select some text (e.g. in gedit), or with the mouse ?