10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi.
I wrote this small bash script, i want to compare second column from file1 with file2 if a pattern matches. Files are small and I am sure that pattern occurs only once. I think this can be rewritten into a awk one liner. Appreciate if someone could give me idea. Whole NR FNR confuse me :o
... (6 Replies)
Discussion started by: ctrld
6 Replies
2. Shell Programming and Scripting
Hello,
I'm using Bash and Sed to replace text within a text file (1.txt) twice in one script. Using a for loop I'm initially replacing any 'apple' words with the variable 'word1' ("leg). I'm then using another for loop to replace any 'apple' words with the variable 'word2' ("arm"). This task is... (2 Replies)
Discussion started by: Flip-Flop
2 Replies
3. Shell Programming and Scripting
Hi all,
Saying we have two files:
1. A "Reference File" whose content is "Variable Name": "Variable Value"
2. A "Model File" whose content is a model program in which I want to substitute "VariableName" with their respective value to produce a third file "Program File" which would be a... (4 Replies)
Discussion started by: dae
4 Replies
4. Shell Programming and Scripting
Hi guys,
I worked for almost a half-day for the replacement of some text automatically with script. But no success.
The problem is I have hundred of files, which need to be replaced with some new text. It's a painful work to work manually and it's so easy to do it wrong.
For example,
I... (2 Replies)
Discussion started by: liuzhencc
2 Replies
5. UNIX for Dummies Questions & Answers
I have a data base of part numbers:
AAA Thing1
BBB Thing2
CCC Thing3
File one is a list of part numbers:
XXXX AAA234
XXXX BBB678
XXXX CCC2345
Is there a sed one-line that would compare a data base with and replace the part numbers so that the output looks like this?
XXXX AAA234... (7 Replies)
Discussion started by: jimmyf
7 Replies
6. Shell Programming and Scripting
Hi,
I have a requirement in which i need to replace text as below -
<stringProp name="Recipe"><AddGroup Name="1001" Path="ServiceAdministration/Controls/1001/ServiceSwitches">
<Param Name="AttributeName" Value="HeaderManipRspIngressRuleSet" Type="String" />
<Param Name="Value"... (0 Replies)
Discussion started by: abhitanshu
0 Replies
7. UNIX for Dummies Questions & Answers
I have an array containing bunch of characters. I have to check this array for specific character and if "Not Found than" use a goto statement to go to USAGE
set options = (A B C D E F)
@ i = 0
while ($i <= ${#options})
if ($options != "F" || $options != "D") then
goto USAGE
endif
@... (1 Reply)
Discussion started by: dixits
1 Replies
8. UNIX for Dummies Questions & Answers
hi,
I have a directory "test" under which there are 3 files a.txt,b.txt and c.txt.
I need to rename those files to a.pl,b.pl and c.pl respectively.
is it possible to achieve this in a sed or awk one liner?
i have searched but many of them are scripts.
I need to do this in a one liner.
I... (2 Replies)
Discussion started by: pandeesh
2 Replies
9. Shell Programming and Scripting
sed awk one liner (2 Replies)
Discussion started by: jap2614
2 Replies
10. UNIX for Dummies Questions & Answers
Hi,
Im trying to find and replace text within a unix file using sed.
The command that i have been using is
sed '/,null,/ s//, ,/g' result.txt>result.tmp
for replacing ",null," with ", ,".
But this only replaces the first occurrance of ,null, in every line. I want to do it globally.
It... (7 Replies)
Discussion started by: sohaibs
7 Replies