Questions tagged [replace]
The replace tag has no summary.
449 questions
3 votes
5 answers
706 views
removing braces statements containing nested braces inside
A typical latex problem: \SomeStyle{\otherstyle{this is the \textit{nested part} some more text...}} Now I want to remove all \SomeStyle{...} but not the content. Content contains nested braces. The ...
6 votes
3 answers
529 views
zmv: Replace double-quote (") in filename
Using zmv on macOS, I'd like to replace double-quotes (") in filenames with underscores (_). However, I'm having trouble getting the zshexpn to correctly isolate the ". Is there some magical ...
1 vote
1 answer
52 views
Search and replace content
PIN A 1 1:3 0:8 0 0:0 PIN B 1 1:0 0 0:0 Z Z:0 PIN C 1 1:3 0:8 0 0:0 Z Z:0 I would like to change the content on PIN A & PIN C only without affecting PIN B to 0 0:3 Z 0:3 Can't seem to find a ...
2 votes
1 answer
203 views
Replacing a character in all files names of a directory
This is homework! I'm trying to replace all spaces in file names with an underscore in the yay directory. It asks me to use the commands xargs and sh without using $(command). I tried using conducts ...
-3 votes
2 answers
116 views
How can find special row and replace special strings
I wrote a todo list script with "add","clear" and "find" argument. I need to pass a "done" argument and script find related row and replace its first column ...
0 votes
3 answers
833 views
Adding 10 whitespace characters using sed
I have written a script that replaces a string, but I need to add the 10 whitespace characters back. I can add it back by pressing space 10 times, and that works, but this looks hideous in my script. ...
0 votes
1 answer
259 views
Replacing multiple substrings in a filename with one (bash or zsh)
I have a text file with filenames, where the filenames contain information in various formats (e.g., resolution 4k, 4K, 2160, XxY etc) and I want to rename files to a singular consistent format. When ...
3 votes
5 answers
429 views
Replace empty lines in one file with lines from another file
I have file1.csv "word 1" "" "word 3" "" "word 5" "word 6" and file2.csv "replacement text 1" "replacement text 2" &...