Hi, I am a newb as far as shell scripting and SED goes so bear with me on this one.
I want to basically append to each line in a file a delimiter character and the line's line number e.g
Change the file from :-
aaaaaa
bbbbbb
cccccc
to:-
aaaaaa;1
bbbbbb;2
cccccc;3
I have worked... (4 Replies)
Hello, I need help in appending the line number of each line to the file and also to get the total number of lines. Can somebody please help me.
I have a file say:
abc
def
ccc
ddd
ffff
The output should be:
Instance1=abc
Instance2=def
Instance3=ccc
Instance4=ddd
Instance5=ffff
... (2 Replies)
Hi,
I have a huge file & I want to add a specific text in column. But I want to add this text from a specific line number to a specific line number & another text in to another range of line numbers.
To be more specific: lets say my file has 1000 lines & 4 Columns. I want to add text "Hello"... (2 Replies)
Hello Everyone.
I am trying to display contains of a file from a specific line to a specific line(let say, from line number 3 to line number 5). For this I got the shell script as shown below:
if ; then
if ; then
tail +$1 $3 | head -n $2
else
... (5 Replies)
Hi Forum.
I was trying to search the following scenario on the forum but was not able to.
Let's say that I have a very large file that has some bad data in it (for ex: 0.0015 in the 12th column) and I would like to find the line number and remove that particular line.
What's the easiest... (3 Replies)
Hi All,
Can you please guide me to search a string in a particular column of file and return the line number of the line where it was found using awk. As an example :
abc.txt
7000,john,2,1,0,1,6
7001,elen,2,2,0,1,7
7002,sami,2,3,0,1,6
7003,mike,1,4,0,2,1
8001,nike,1,5,0,1,8... (3 Replies)
Hello everyone,
I don't really know anything about scripting, but I have to manage to make this script, out of necessity.
#!/bin/bash
while read -r line; do #I'm reading from a big wordlist
instructions using $line
done
Is there a way to automatically write the $line number the script... (4 Replies)
Hi,
I have a set of files in a directory that I have to read and replace the first occurrence of a number with another dummy number. This is what I have so far but it does not seem to work. The files have lot of other data in each row and each data element is separated by ,@,
for file in... (13 Replies)
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies
LEARN ABOUT DEBIAN
dpkg-mergechangelogs
dpkg-mergechangelogs(1) dpkg suite dpkg-mergechangelogs(1)NAME
dpkg-mergechangelogs - 3-way merge of debian/changelog files
SYNOPSIS
dpkg-mergechangelogs [option...] old new-a new-b [out]
DESCRIPTION
This program will use the 3 provided versions of the Debian changelog to generate a merged changelog file. The resulting changelog is
stored in the file out or output to the standard output if that parameter is not given.
Each entry is identified by its version number and they are assumed to be not conflicting, they are simply merged in the right order (by
decreasing version number). When --merge-prereleases is used, the part of the version number after the last tilde is dropped so that
1.0-1~exp1 and 1.0-1~exp5 are considered to be the same entry. When the same version is available in both new-a and new-b, a standard line-
based 3-way merge is attempted (provided that the module Algorithm::Merge is available -- it's part of the package libalgorithm-merge-perl
-- otherwise you get a global conflict on the content of the entry).
OPTIONS --merge-prereleases, -m
Drop the part after the last tilde in the version number when doing version comparison to identify if two entries are supposed to be
the same or not.
This is useful when you keep using the same changelog entry but you increase its version number regularly. For instance, you might
have 2.3-1~exp1, 2.3-1~exp2, ... until the official release 2.3-1 and they are all the same changelog entry that has evolved over
time.
--help Show the usage message and exit.
--version
Show the version and exit.
LIMITATIONS
Anything that is not parsed by Dpkg::Changelog is lost during the merge. This might include stuff like vim modelines, comments which were
not supposed to be there, etc.
INTEGRATION WITH GIT
If you want to use this program to merge Debian changelog files in a git repository, you have first to register a new merge driver in
.git/config or ~/.gitconfig:
[merge "dpkg-mergechangelogs"]
name = debian/changelog merge driver
driver = dpkg-mergechangelogs -m %O %A %B %A
Then you have to setup the merge attribute for the debian/changelog file either in .gitattributes in the repository itself, or in
.git/info/attributes:
debian/changelog merge=dpkg-mergechangelogs
Debian Project 2011-08-14 dpkg-mergechangelogs(1)