Questions tagged [whitespace]
73 questions
312
votes
6 answers
How to match whitespace in sed?
How can I match whitespace in sed? In my data I want to match all of 3+ subsequent whitespace characters (tab space) and replace them by 2 spaces. How can this be done?
Peter Smit
- 9,346
- 13
- 45
- 45
100
votes
10 answers
How do I automatically trim trailing whitespace with Notepad++?
I don't want to delete the empty lines completely, but I want to remove the trailing tabs and whitespaces in them. Eclipse usually does it (through a preference setting) when we save the file.
For example, the file before saving ($ = end of…
Srikanth
- 4,799
- 7
- 31
- 27
67
votes
10 answers
Is there a way to not select whitespace after a word when double-clicking?
In Windows, it seems the default behavior when double-clicking a word is to select the word, and any whitespace following the word (spaces or tabs). You can see this behavior across all programs, so I'm assuming this isn't a per-program setting.…
Doozer Blake
- 805
- 2
- 7
- 7
66
votes
3 answers
Jump to first non-whitespace character in line in emacs
I'm looking for the emacs equivalent of vi's ^.
How can I move my cursor to the first non-whitespace character in a line?
Alexander Bird
- 1,827
- 4
- 19
- 25
55
votes
4 answers
How to insert tab character in Text mode?
I have tried to parse a file language_data.txt, which is edited by Emacs. The different columns are separated by tab characters.
But when I opened the file, I found that each of the tab characters had been replaced by many space characters. For…
Chen Yu
- 725
- 1
- 5
- 6
29
votes
1 answer
how can I tell vimdiff to ignore whitespace?
I made a number of changes in a file I'm working on, including indentation changes. I'm using vimdiff to compare the file to the original version, and I don't want to see these changes, since they're basically cosmetic.
How can I tell vimdiff to…
Nathan Fellman
- 9,372
- 20
- 62
- 82
28
votes
5 answers
How to start/open a file/folder that contains space in its name through command-line?
I'm trying to use the start command in the command prompt to open files and folders, but I'm unable to open files and folders that contain space(s) in their name.
I have tried the following queries (testing on C:\Program Files):
start C:\Program…
amiregelz
- 8,099
- 12
- 48
- 58
20
votes
3 answers
How can I write space in Terminal on OS X?
I have a folder name with a space between words. I tried to use cd to move into that folder but it didn't work. How can I write space in Terminal on OS X? I tried following
MacBook-Pro:TestDrop Alexsander$ cd October Fall
-bash: cd: October: No such…
Alexander Khitev
- 303
- 1
- 2
- 10
17
votes
6 answers
Difference in whitespace between two files on Linux
I have two files that when I compare with diff show that every line has changed. When I compare them with diff -w (ignoring whitespace) it shows the few minimal changes that I expect.
Obviously there is some difference between the whitespace in…
Romski
- 315
- 1
- 2
- 9
14
votes
2 answers
Show whitespace characters in printout
I need to render an ASCII file for printing in a way that removes ambiguity if (very unlikely) one decides to type it in and validate the signatures.
I am giving the 8-bit symbol-set QR code as an alternative, but a manual validation would be a…
qdot
- 816
- 1
- 7
- 21
12
votes
3 answers
Improve display of whitespace on notepad++
Can you improve the visibility of whitespace using notepad++?
I tried Settings > Style > Whitespace Symbol, and am able to change the color as needed, but I still find the symbols incredibly small and hard to find.
My resolution is 1280x, so that…
zuiqo
- 696
- 1
- 7
- 21
9
votes
2 answers
Delete whitespace left and right in Notepad++
In Notepad++, is there a hotkey to wipe all white space left and right of the cursor?
I'd imagine it would be the same as "delete current word", but I can't find it.
Ctrl + Del deletes to the end of the word
Ctrl + Backspace deletes to the…
MrSparkly
- 237
- 1
- 2
- 6
9
votes
2 answers
How to remove strange space symbols in Word
I got Word files from one guy, written in Russian and convert them to HTML.
These files contain some strange white-space characters, for example:
This looks like small zero (I changed mode to show special characters). In hide mode it's just…
Alexan
- 307
- 1
- 6
- 21
8
votes
2 answers
Trim trailing newline in one-liner bash alias
I'm trying to write a simple alias on my Mac OS X terminal to copy the current working directory. I have this:
alias cpwd="echo \`pwd\` | pbcopy; echo \"Copied \`pwd\`\""
Then I can just run the following to copy it:
$ cpwd
Problem is that echo…
Sean Adkinson
- 3,275
- 3
- 17
- 13
8
votes
2 answers
Unexpected duplicate directory names after expanding `%~dp0` in a BAT file
I'm on Windows 10 Enterprise x64. I have the following hierarchy of directories with a BAT file at the innermost level:
C:\
dir\
my files\
run.bat
The BAT file contains the following lines:
@pushd %~dp0
@echo %~dp0
@popd
(the meaning…
Vladimir Reshetnikov
- 777
- 1
- 8
- 20