10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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)
Discussion started by: mac-arrow
9 Replies
2. UNIX for Beginners Questions & Answers
I have a file like this:
FileName,Well,Sample Description,Size ,Calibrated Conc. ,Assigned Conc. ,Peak Molarity ,Area,% Integrated Area,Peak Comment,Observations
2017-11-15 - 13.49.50.D1000,EL1,Electronic Ladder,25,5.22,,321,0.803,,,Lower Marker
2017-11-15 - 13.49.50.D1000,EL1,Electronic... (6 Replies)
Discussion started by: Xterra
6 Replies
3. Shell Programming and Scripting
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)
Discussion started by: Nic2015
11 Replies
4. Shell Programming and Scripting
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)
Discussion started by: lneedh1
4 Replies
5. Shell Programming and Scripting
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)
Discussion started by: dvah
2 Replies
6. Shell Programming and Scripting
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)
Discussion started by: Dolph
3 Replies
7. Shell Programming and Scripting
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)
Discussion started by: hcclnoodles
2 Replies
8. UNIX for Dummies Questions & Answers
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)
Discussion started by: Dave724001
2 Replies
9. Shell Programming and Scripting
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)
Discussion started by: george_
5 Replies
10. Shell Programming and Scripting
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)
Discussion started by: dbrundrett
7 Replies