Maybe I should expailed myself more thoroughly. What I am trying to do is pick up a string of text from the begining of the line, an example of the string is this: "05-03-2013-08-59-16", this string is actualy a time stamp, that is associated with a number of file names that appear later on in the same line. The file names all end the same way, that is with a ".pdf_.html" I need to insert the string from the beginning of the line between the ".pdf_" and the ".html" everytime there is an occurance of ".pdf_.html"
Here is an example of the original text file:
And the following is the way I need it to look:
Also string that represents the time stamp will never be constant except for the format of numbers and dashes, and I need to perform the same operation on a number of files with changing time stamps and filenames.
The only constant will be the format of the timestamp and the position of the string: ".pdf_.html" at the end of the file names
thanks very much for all your help
Hello. Trying to insert text at line 1 and after last line of file. I have searched posts but nothing seems to work. I keep getting extra characters error or nothing gets inserted into the file.
#!/bin/sh
touch textfile.txt
sed 'i\
Add this line before every line with WORD' textfile.txt
... (5 Replies)
Hi all,
I need to insert new text and change existing text in a file. For that I used the below line in the command line and got the expected output.
sed '$a\
hi...
' shell > shell1
But I face problem when using the same in script. It is throwing the error as,
sed: command garbled:... (4 Replies)
Hello. I'm trying to insert text in various positions and I could only do that using pipes for each position.
Example:
cat file | sed -e 's#\(.\{5\}\)\(.*\)#\1:\2#g' | sed -e 's#\(.\{26\}\)\(.*\)#\1:\2#g'
Insert ":" at position 5 and 26.
it can be done in the same sentence, without using... (4 Replies)
Hi,
I use sed to insert text at beginning of a file. But sed inserts a newline after my text that I do not need. For example, I want to insert "foo" at the beginning of my file:
> cat myfile
This is first line.
> sed -i '1i\foo' myfile
> cat myfile
foo
This is first line.
... (5 Replies)
sed '1r file.txt' <source.txt >desti.txt
This example will insert 'file.txt' between line 1 and 2 of source.txt.
sed '0r file.txt' <source.txt >desti.txt
gives an error message.
Does anyone know how 'sed' can insert 'file.txt' before the first line of source.txt? (18 Replies)
I have:
/path/to/my/fixdir/MD1234567.tar
I want to have:
/path/to/my/fixdir/MD/1234567.tar
fixdir never changes but MD does and how many numerical digits does. I want something like:
/usr/bin/sed 's/fixdir\/../fixdir\/..\//'
This ends up:
/path/to/my/fixdir/../1234567.tar
But... (3 Replies)
Hi
I am trying to insert a block of text 2 lines above a pattern match using sed
eg
#Start of file entry
{
}
#End of file entry
new bit of text has to be put in just above the } eg
#Start of file entry
{
New bit of text
}
#End of file entry (7 Replies)
Hello, I am trying to insert a section of text between lines in another text file.
The new lines to be inserted are:
abcd.efgh.zzzz=blah
abcd.efgh.xxxx=blah
Where N = 0 to 2
Original File:
abcd.efgh.wwxx=aaaaa
abcd.efgh.yyzz=bbbbb
abcd.efgh.wwxx=aaaaa
abcd.efgh.yyzz=bbbbb... (3 Replies)
Discussion started by: tsu3000
3 Replies
LEARN ABOUT SUSE
man.conf
MAN.CONF(5) File Formats Manual MAN.CONF(5)NAME
man.conf - configuration file for man
DESCRIPTION
This is the configuration file for the man(1), apropos(1), and makewhatis(8) utilities. Its presence, and all directives, are optional.
This file is an ASCII text file. Leading whitespace on lines, lines starting with '#', and blank lines are ignored. Words are separated
by whitespace. The first word on each line is the name of a configuration directive.
The following directives are supported:
manpath path
Override the default search path for man(1), apropos(1), and makewhatis(8). It can be used multiple times to specify multiple
paths, with the order determining the manual page search order.
Each path is a tree containing subdirectories whose names consist of the strings 'man' and/or 'cat' followed by the names of
sections, usually single digits. The former are supposed to contain unformatted manual pages in mdoc(7) and/or man(7) format; file
names should end with the name of the section preceded by a dot. The latter should contain preformatted manual pages; file names
should end with '.0'.
Creating a mandoc.db(5) database with makewhatis(8) in each directory configured with manpath is recommended and necessary for
apropos(1) to work, but not strictly required for man(1).
output option [value]
Configure the default value of an output option. These directives are overridden by the -O command line options of the same names.
For details, see the mandoc(1) manual.
option value used by -T
fragment none html
includes string html
indent integer ascii, utf8
man string html
paper string ps, pdf
style string html
width integer ascii, utf8
_whatdb path/whatis.db
This directive provides the same functionality as manpath, but using a historic and misleading syntax. It is kept for backward
compatibility for now, but will eventually be removed.
FILES
/etc/man.conf
EXAMPLES
The following configuration file reproduces the defaults: installing it is equivalent to not having a man.conf file at all.
manpath /usr/share/man
manpath /usr/X11R6/man
manpath /usr/local/man
SEE ALSO apropos(1), man(1), makewhatis(8)HISTORY
A relatively complicated man.conf file format first appeared in 4.3BSD-Reno. For OpenBSD 5.8, it was redesigned from scratch, aiming for
simplicity.
AUTHORS
Ingo Schwarze <schwarze@openbsd.org>
Debian December 28, 2016 MAN.CONF(5)