06-18-2012
Thanks, that worked great. Sed is such a great tool. I had a 250K text file with odd formatting that would have blown up the next tool in the chain and sed fixed it in 23s. At times, it does look a bit like hieroglyphics, and I really need to find my notes, but there is nothing like the right tool for the job.
Thanks again,
LMHmedchem
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I want to write a sed script which from
batiato:
batiato/giubbe:
pip_b.2.txt
pip_b.3.txt
pip_b.3mmm.txt
bennato:
bennato/peterpan:
123.txt
consoli:
pip_a.12.txt
daniele: (2 Replies)
Discussion started by: one71
2 Replies
2. Shell Programming and Scripting
Please let me know wat would be sed command to delete any partcular line from a file and also moving lines below it to up.
ie wen line #9 is deleted data in line #10 should move to #9 and so on. (2 Replies)
Discussion started by: fidelis
2 Replies
3. Shell Programming and Scripting
I'm new to using sed and grep commands, but have found them extremely useful. However I am having a hard time figuring this one out:
Delete every line containing the word CEN and the next line as well.
ie. test.txt
blue
324 CEN
green
red
blue
324 CEN
green
red
blue
to produce:... (2 Replies)
Discussion started by: rocketman88
2 Replies
4. Shell Programming and Scripting
Can any one help me how the sed delete only first line command (D) works.
sed -f sedcmds File.txt
In this how the sed delete only first line command (D) works to delete the blank lines appearing more than ones leaving only one blank and deleting others blanks.
While doing step by step when... (2 Replies)
Discussion started by: gwgreen1
2 Replies
5. Shell Programming and Scripting
I want to delete a line between selected lines using sed:
e.g. : Between "bus" to "pins", delete lines conaining "signal" word.
Input :
bus
direction
signal new
signal old
pins
signal ok
end
Desired Output:
bus
direction
pins
signal
end (4 Replies)
Discussion started by: nehashine
4 Replies
6. Shell Programming and Scripting
HI,
Im using the below commmand to delete lines having "(" at the start of a line.
sed -e '/^(/d'
But i need a command to delete lines that has only "(" in it and no other strings.
infile -
asdf
asdf
( asdf
(
asd
outfile (1 Reply)
Discussion started by: dvah
1 Replies
7. Shell Programming and Scripting
Hello,
I want to delete all lines with given string in file1 and the string val is dynamic.
Can this be done using sed command.
Sample:
vars="test twinning yellow"
for i in $vars
do
grep $i file1
if
then
echo "Do Nothing"
else
sed `/$i/d` file1
fi
done
Using the above... (5 Replies)
Discussion started by: PrasadAruna
5 Replies
8. Shell Programming and Scripting
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
9. Shell Programming and Scripting
Hi.
In need to delete line before and after pattern in file. I came to following commands.
Delete line before
sed -ni '/pattern/{x;d;};1h;1!{x;p;};${x;p;}' /etc/testfile
Delete line after
sed -i '/pattern/{N;s/\n.*//;}' /etc/testfile
Is it possible to merge it in single command? (3 Replies)
Discussion started by: urello
3 Replies
10. Shell Programming and Scripting
hello Team,
I want to delete below linux using sed command but I am getting error.sed -i '/url=/status.cgi?hostgroup=/d' 3
error:sed: -e expression #1, char 32: unknown option to `s'
Could you please help me with correct syntax.
My line contain / character because of that I am getting... (4 Replies)
Discussion started by: ghpradeep
4 Replies
LEARN ABOUT CENTOS
git-mergetool
GIT-MERGETOOL(1) Git Manual GIT-MERGETOOL(1)
NAME
git-mergetool - Run merge conflict resolution tools to resolve merge conflicts
SYNOPSIS
git mergetool [--tool=<tool>] [-y | --[no-]prompt] [<file>...]
DESCRIPTION
Use git mergetool to run one of several merge utilities to resolve merge conflicts. It is typically run after git merge.
If one or more <file> parameters are given, the merge tool program will be run to resolve differences on each file (skipping those without
conflicts). Specifying a directory will include all unresolved files in that path. If no <file> names are specified, git mergetool will run
the merge tool program on every file with merge conflicts.
OPTIONS
-t <tool>, --tool=<tool>
Use the merge resolution program specified by <tool>. Valid values include emerge, gvimdiff, kdiff3, meld, vimdiff, and tortoisemerge.
Run git mergetool --tool-help for the list of valid <tool> settings.
If a merge resolution program is not specified, git mergetool will use the configuration variable merge.tool. If the configuration
variable merge.tool is not set, git mergetool will pick a suitable default.
You can explicitly provide a full path to the tool by setting the configuration variable mergetool.<tool>.path. For example, you can
configure the absolute path to kdiff3 by setting mergetool.kdiff3.path. Otherwise, git mergetool assumes the tool is available in PATH.
Instead of running one of the known merge tool programs, git mergetool can be customized to run an alternative program by specifying
the command line to invoke in a configuration variable mergetool.<tool>.cmd.
When git mergetool is invoked with this tool (either through the -t or --tool option or the merge.tool configuration variable) the
configured command line will be invoked with $BASE set to the name of a temporary file containing the common base for the merge, if
available; $LOCAL set to the name of a temporary file containing the contents of the file on the current branch; $REMOTE set to the
name of a temporary file containing the contents of the file to be merged, and $MERGED set to the name of the file to which the merge
tool should write the result of the merge resolution.
If the custom merge tool correctly indicates the success of a merge resolution with its exit code, then the configuration variable
mergetool.<tool>.trustExitCode can be set to true. Otherwise, git mergetool will prompt the user to indicate the success of the
resolution after the custom tool has exited.
--tool-help
Print a list of merge tools that may be used with --tool.
-y, --no-prompt
Don't prompt before each invocation of the merge resolution program.
--prompt
Prompt before each invocation of the merge resolution program. This is the default behaviour; the option is provided to override any
configuration settings.
TEMPORARY FILES
git mergetool creates *.orig backup files while resolving merges. These are safe to remove once a file has been merged and its git
mergetool session has completed.
Setting the mergetool.keepBackup configuration variable to false causes git mergetool to automatically remove the backup as files are
successfully merged.
GIT
Part of the git(1) suite
Git 1.8.3.1 06/10/2014 GIT-MERGETOOL(1)