10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi alll
I have a file with this content
ale,AAM,id2_1_2_1_1,23,2013-01-30,1,1
ale,BAND,id2_1_1_1_1,31,2013-01-28,1,1
ale,CAI,id2_1_1_1_1,23,2013-01-28,1,1
ale,CAI,id2_1_1_1_4,23,2013-01-28,1,1
ale,CAI,id2_1_2_1_1,23,2013-01-30,2,1
ale,NAST,id2_1_1_1_1,23,2013-01-29,1,1... (1 Reply)
Discussion started by: nikhil jain
1 Replies
2. Shell Programming and Scripting
I have a file with some numbers having single quotes around them which I want to remove.
i.e. '923930' -> 23930
If it can be done without using sed thats fine. I have tried with sed but can't think how to replace this pattern on only the numbers (13 Replies)
Discussion started by: user_invalid
13 Replies
3. UNIX for Dummies Questions & Answers
I'm a noob to unix, and I have a line of data like the following:
title=Boston|tcolor=green|desc=Large city in New England|url=www.boston.com
Is there a way to change a field value with sed substitution?
(i.e. change tcolor=green to tcolor=blue)
I figured out: sed... (19 Replies)
Discussion started by: stabby
19 Replies
4. Shell Programming and Scripting
Using sed I'm trying to replace 'string' with ']' while retaining case and ignoring words with 'string' in it along with additional characters like 'strings' and those which already contain the ] wrapper. I'm hoping to do it with sed and the right expression, if possible.
Example:
Apple... (2 Replies)
Discussion started by: tom.lee
2 Replies
5. Shell Programming and Scripting
Hi,
I am facing a strange problem. I have a script that used the following to search and replace text:
sed 's/'"${find_var_parm}"'/'"${find_var_filter}"'/g' $ParmFile > $TempFile
The values of $find_var_parm and $find_var_filter are set based on search criteria. The above seems to be working... (2 Replies)
Discussion started by: arsh
2 Replies
6. Shell Programming and Scripting
Hi I am trying to do a text insertion in a text file at a particular line number in a shell script. However its not working.
sed '122i\
> for j in \`echo $MyList\` ; do perl -pi -e\'s#01\/01\/2009#01\/01\/2011#\' $j ; done' $HOME/MyScript.ksh
The Actual line to be inserted at line 122... (5 Replies)
Discussion started by: som.nitk
5 Replies
7. Shell Programming and Scripting
Can anyone please help me on this.
i have a file with lines say
X X3200 X
X X
X2400 X X4100
I want to use sed to put the numbers in braces.
the output should be like,
X X(3200) X
X X
X(2400) X X(4100) (7 Replies)
Discussion started by: diliphp
7 Replies
8. Shell Programming and Scripting
I have file.txt
1 4 7 9 3
I want to replace the tabs with a space, but my code doesn't work.
cat file.txt | sed 's/"\t"/ /g' > t.txt
But file is still the same. Numbers seperated by tabs instead of spaces.
Help? (2 Replies)
Discussion started by: Bandit390
2 Replies
9. Shell Programming and Scripting
Hi,
heres my problem:
echo "aaaa(aaaa(aaa" | sed 's/a.*(//g'
gives aaa
but it should give aaaa(aaa
.*( should find any string to the appearance of (, but it finds any string to the last appearance, any idea why, and how to do this?
and what if the string ist... (2 Replies)
Discussion started by: funksen
2 Replies
10. UNIX for Dummies Questions & Answers
I know we can substitute a string using sed but how?
For example: sed 's/(old variable)/(new variable)/ details.dat
Am I suppose to put $old variable or whatever? Because I tried many times, it didnt work by putting $old variable. Am I suppose to enclose it with "" or ''?
Please help (3 Replies)
Discussion started by: Ohji
3 Replies