Hi All
I have a script which has produced a list, I have used 'sed' to number my list, but i want to list at end of line with the first line starting at zero (0) and brackets round it
ie
My List i want
Hello (0)
this (1)
day (2)
can (3)
be (4)
sed '/./=' filename | sed '/./N; s/\n/) /'... (5 Replies)
Hi,
I have to update last line of a text file with the number of lines in that file. This last line will have text such as 0.0000 and I should replace this with number lines. If lines are 20 then it should be replaced with 00020. Any sed or awk cmd help would be appreciated (3 Replies)
Hi there,
may someone easily help me on this :
I want to insert a text in a specific line number like :
linenumb2start=`cat memory_map.dld | nl -ba | egrep -i "label" | cut -f1`
line2insert=`expr $linenumb2start + 2`
and now I need to replace something like {} with {comment} at... (8 Replies)
Alright, I'm sure there's a more efficient way to do this... I'm not an expert by any means. What I'm trying to do is search a file for lines that match the two input words (first name, last name) in order to remove that line. The removal part is what I'm struggling with. Here is my code:
echo... (4 Replies)
Hi,
I want to print the line number with the pattern of the line on a same line using multi-patterns in sed.
But i don't know how to do it.
For example, I have a file
abc
def
ghi
I want to print
1 abc
2 def
3 ghi
I know how to write it one line code, but i don't know how to put... (11 Replies)
I Have file1 with below lines :
#HostNameSelection=0 :NotUsed
#HostNameSelection=1 :Automatic
#HostNameSelection=3 :NotForced
I have file2 which has similar lines but with different values
I want to copy the changes from file1 to file2 ,line by line only if line begins with '#'.
for... (7 Replies)
num=10
sed -n '$num p' test.txt
sed -n '10 p' test.txt works
however i am putting the sed command in a loop and the line number is not static
Can someone please help me how to achive this. (1 Reply)
Hi,
I have a file as below
This is the line one
This is the line two
<\XMLTAG>
This is the line three
This is the line four
<\XMLTAG>
Output of the SED command need to be as below.
This is the line one
This is the line two
<\XMLTAG>
Please do the need to needful to... (4 Replies)
my requirement is,
consider a file output
cat output
blah sdjfhjkd jsdfhjksdh
sdfs 23423 sdfsdf sdf"sdfsdf"sdfsdf"""""dsf
hellow there
this doesnt look good
et cetc etc
etcetera
i want to replace a line of line number 4 ("this doesnt look good") with some other line
... (3 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
cronosplit
cronosplit(1m)cronosplit(1m)NAME
cronosplit - split log files into cronolog-compatible files
SYNOPSIS
cronosplit --template=TEMPLATE [--print-invalid] [--help] [--version] file ...
DESCRIPTION
cronosplit is a simple program that reads lines from a set of input log files, which must be in Common Log Format or NCSA Combined/XLF/ELF
Format and write each lines to an output files, the name of which is constructed using the template specified and timestamp from the the
line. The template uses the same format specifiers as the Unix date(1) command (which are the same as the standard C strftime library
function).
Options
cronosplit accepts the following options and arguments:
--template=TEMPLATE
specifies the template for the output log files (using the format specifiers described below).
--print-invalid
print invalid log file entries to the standard error stream.
--utime
update modification time of output file according to last parsed log entry.
--verbose
print additional status messages to the standard error stream.
--debug
print debug messages to the standard error stream.
--help print a help message and then exit.
--version
print version information and exit.
Template format
Each character in the template represents a character in the expanded filename, except for date and time format specifiers, which are
replaced by their expansion. Format specifiers consist of a `%' followed by one of the following characters:
% a literal % character
n a new-line character
t a horizontal tab character
Time fields:
H hour (00..23)
I hour (01..12)
p the locale's AM or PM indicator
M minute (00..59)
S second (00..61, which allows for leap seconds)
X the locale's time representation (e.g.: "15:12:47")
Z time zone (e.g. GMT), or nothing if the time zone cannot be determined
Date fields:
a the locale's abbreviated weekday name (e.g.: Sun..Sat)
A the locale's full weekday name (e.g.: Sunday .. Saturday)
b the locale's abbreviated month name (e.g.: Jan .. Dec)
B the locale's full month name, (e.g.: January .. December)
c the locale's date and time (e.g.: "Sun Dec 15 14:12:47 GMT 1996")
d day of month (01 .. 31)
j day of year (001 .. 366)
m month (01 .. 12)
U week of the year with Sunday as first day of week (00..53, where week 1 is the week containing the first Sunday of the year)
W week of the year with Monday as first day of week (00..53, where week 1 is the week containing the first Monday of the year)
w day of week (0 .. 6, where 0 corresponds to Sunday)
x locale's date representation (e.g. today in Britain: "12/04/96")
y year without the century (00 .. 99)
Y year with the century (1970 .. 2038)
Other specifiers may be available depending on the C library's implementation of the strftime function.
SEE ALSO apache(1m)cronolog(1m)date(1)strftime(3)environ(5)
More information and the latest version of cronolog and cronosplit can be obtained from
http://www.ford-mason.co.uk/resources/cronolog/
If you have any suggestions, bug reports, fixes, or enhancements, please mail them to the author.
More about Apache
Documentation for the Apache http server is available from
http://www.apache.org
AUTHOR
Andrew Ford <A.Ford@ford-mason.co.uk>
cronosplit is based on a script called splitlog by Roy Fielding, which is part of the wwwstat package.
March 1998 cronosplit(1m)