I have a configuration file that when a certain script runs in updates. I want to use sed and can't seem to get the syntax right.
A line from the configuration file looks like:
DATE=20040909 12:00:10
When the script is run I want to change the date and time, i.e. removing the previous... (7 Replies)
hello!
I have a few sed commands
sed '/^$/d' < $1 > tmp.t
sed '/^ \{3,\}/d' < tmp.t > tmp1.txt
.....
how can I write them in a single line?
sed '/^$/d' < $1 > | '/^ \{3,\}/d' < $1 > tmp1.txt
any idea?
thanks. (5 Replies)
I would like to change the lines:
originalline1
originalline2
to:
originalline1new
originalline1newline
originalline2new
originalline2newline
To do this, id like to combine the commands:
sed 's/^/&new/g' file > newfile1
and
sed '/^/ a\\
newline\\
\\ (2 Replies)
Hi there, I need to be able to put the hostid of my box into a file (replacing the text "enter_hostid_here" so i tried
sed -e 's/enter_hostid_here/`hostid`/g' inputfile > outputfile
but it takes the `hostid` literally as text .....how can I get this info into the file (ideally in a single... (2 Replies)
Hello
I need to run some sed commands but it involves "/" in the substitute or delete, any ideas how I get round the problem.
Example:
cat file1.txt | sed -e '/</Header>/d' > file2.txt
This errors due to the forward slash before the Header text.
Thanks (3 Replies)
Hi,
I've a shell that uses two sed commands to tailor a file.
sed 's/ */ /g' | sed 's/%/%%/g'
Is it possible to merge this in to a single sed?
Thanks! (2 Replies)
Hello, would you please help me with why my SED command file is outputting the entire input file instead of only the text that I'm trying to block?
cat testfile
O 111111111-00
DUE-DATE
METHOD:
FREQUENCY:
O 222222222-00
DUE-DATE
METHOD:
FREQUENCY:
O 333333333-02
DUE-DATE
METHOD:... (4 Replies)
Hi,
I get the following response by gphoto2 and I would like to substract the index number of the current item. In this case 3.
gphoto2 --get-config /main/imgsettings/iso
Label: ISO Speed
Type: RADIO
Current: 200
Choice: 0 100
Choice: 1 125
Choice: 2 160
Choice: 3 200
Choice: 4 250
..... (11 Replies)
Hi!
I have a text file which I would like to sort, summarise and count between the pattern "--Current Database"
This is my text file:
-- Current Database: `city`
New York
Chicago
Las Vegas
San Francisco
-- Current Database: `country`
United States
Mexico
Portugal
Mexico
Mexico... (9 Replies)