10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi I want to use sed to change a text files input into an awk script.
For example if the input says " chord -- english " I want to change this using sed 's/pattern 1 /pattern 2 /'g filename but I don't understand how to use part of the pattern 1 to input that into pattern 2 . Like after... (10 Replies)
Discussion started by: enforcer
10 Replies
2. Shell Programming and Scripting
UNIX gurus
I need your help with the following (The server is an AIX box).
I have a text file with the following information:
********************************************************
SOME LINES
case
:WORD1
SOME LINES
:WORD2
SOME LINES
:WORD3
SOME LINES
esac
SOME LINES... (7 Replies)
Discussion started by: curiousmal
7 Replies
3. Shell Programming and Scripting
I have a csv file formatted like this:
2014-08-21 18:06:26,A,B,12345,123,C,1232,26/08/14 18:07and I'm trying to change it to MM/DD/YYYY HH:MM for both occurances.
I have got this:
awk -F, 'NR <=1 {print;next}{"date +%d/%m/%Y\" \"%H:%m -d\""$1 "\""| getline dte;$1=dte}1' OFS="," test.csvThis... (6 Replies)
Discussion started by: say170
6 Replies
4. Shell Programming and Scripting
I have a bunch of file numbers in the file 'test':
I'm trying the above command to change all the instances of "H" to "Na+" in the file testsds.pdb at the line numbers indicated in the file 'test'. I've tried the following and various similar alternatives but nothing is working:
cat test |... (3 Replies)
Discussion started by: crunchgargoyle
3 Replies
5. Shell Programming and Scripting
I want change the file when the line contains $(AA) but NOT contains $(BB), then change $(AA) to $(AA) $(BB)
eg:
$(AA) something
$(AA) $(BB) something (7 Replies)
Discussion started by: yanglei_fage
7 Replies
6. Shell Programming and Scripting
So I'm new to this sed command and I am trying to create a script that replaces ip addresses when I name a file but can't tweak it to work.
Here is what it looks like:
#!/bin/bash
#
file=$1
#
sed -e 's/-CPUaddr 10.30.10.166/-CPUaddr 10.30.10.151/g' -i "$file"
sed -e 's/-CPUaddr... (10 Replies)
Discussion started by: uradunce
10 Replies
7. UNIX for Dummies Questions & Answers
The file is repeating blocks of text separated by a blank line. Some of the lines are unique.
e.g.:
This is unique line
This is line 2
This is line 3
This is line 4
This is unique line
This is line 2
This is line 3
This is line 4
...
The goal is to change/replace line 4... (2 Replies)
Discussion started by: uiop44
2 Replies
8. Shell Programming and Scripting
Hi
I want to create a configuration file from a template one.
The only thing to change for now is the port number that I need to take from another file that has this format:
server:port
So I need to take the 2nd field.
server is passed in the script argument.
how to do that? I... (1 Reply)
Discussion started by: melanie_pfefer
1 Replies
9. Shell Programming and Scripting
Hello,
I have a file which contains some line as follows,
9.9 TEMP
9.9 MUCOEFF
0.0 EPSILON
And I want to increase this MUCOEFF by 0.2 as
9.9 TEMP
10.1 MUCOEFF
0.0 ... (7 Replies)
Discussion started by: lorenzz
7 Replies
10. Shell Programming and Scripting
I have a file like below:
I want to delete the rows which begining with "BC" "CD" and "TY" .
then change every fields into one row like this
at last delete the head words :
USing awk to change it is not hard.
I want to know how to do this work using SED ?
Thank you!
... (4 Replies)
Discussion started by: bejgirl
4 Replies