Hi
Input:
Code:
-
--
---
----
aa-bb-cc
aa--bb--cc
aa---bb---cc
aa----bb----cc
Output:
Code:
.
-
-.
--
aa.bb.cc
aa-bb-cc
aa-.bb-.cc
aa--bb--cc
I need to replace a simple '-' with '.' but if I want to keep the '-' I will use '--'
I would a like a solution where regex is used as search criteria and the match will be replace with a value.
Hi there,
Does anyone know of an editor that can search and replace with regex?
I've tried both bluefish and geany but they can only search with a regex but not replace with a regex.
Bluefish seems to support groups, while geany does not.
But can't get bluefish to work with regex in replace field.
I want to search for this:
Code:
(?'prefix'[<][t][i][n][>][0-9]{6})(?'dash'[-])(?'su
Hello,
I am trying to search and replace but I don't know how to do it. My simple knowlegde in search and replace using sed is not helping me at all.
File:
Code:
its a cause value #22: dfg ggg
Cause value #1: aasfa fasdf
asfa value #22: affg gggg
Basically i want to replace the colon(:) with hash (#) while retaining the rest of the words on that line.
Assume I have a big file, ~1k lines, and I need to delete the line after some pattern, lets call it: somePatern.
Conditions:
cannot be done by hand (no searching -- /somePattern, and/or manually moving down one line and deleting).
preferably a single liner.
I am trying to write my gsub regex to replace a bunch of special characters with spaces, so i can split it to an array and look at each word independently.
However, my regex skills are slightly lacking and I appear to be missing a quote or something here.
I am trying to replace the following characters \/;:'"`()| with a space.
Code:
gsub ( "[\\'|\\"|\\:|\\;|\\`|\\(|\\
I have a strange issue with large files and bash. This is the context:
I have a large file: 75G and 400,000,000+ lines (it is a log file, my bad, I let it grow).
The first 10 chars of each line is a time stamps in the format YYYY-MM-DD.
I want to split that file: one file per day.
I tried with the following script that did not work.
We have already seen an official command line google product, googlecl, but this is not the only one. There have always been shell lovers who tried to bring this Web Giant on a console.
hi I am trying to use SED to replace the line matching a pattern using the command
sed 'pattern c\
new line
' <file1 >file 2
I got two questions
1. how do I insert a blank space at the beginning of new line?
2. how do I use this command to execute multiple command using the -e options (if possible)? as I want to replace multiple lines in a single file.
Thanks
Robert
I would like to remove carriage returns/line feeds in a text file, but in a specific cadence:
Read first line (Header Line 1), remove cr/lf at the end (replace it with a space ideally);
Read the next line (Line of Text 2), leave the cr/lf intact;
Read the next line, remove the cr/lf;
Read the next line (Header Line 2), remove cr/lf at the end (replace it with a space);
Read the next line (Line of