10 More Discussions You Might Find Interesting
1. Solaris
I am unable to make it work. I tried dbl quotes ...etc. Nothing works. I am trying to replace value in an XML file to current system date/time. Here is my code:
NTIMESTAMP=`date '+%m%d%Y%H%M%S'`
sed -e 's|<TIMESTAMP>\{1,\}|<TIMESTAMP>$NTIMESTAMP|g' $QLOG
Input data sample:
... (5 Replies)
Discussion started by: mrn6430
5 Replies
2. UNIX for Dummies Questions & Answers
Hi,
We receive flat files with fixed width data
Now our goal is append from right null or space to each record if the lenght of the record is less than for example 10.
for example
123 45 6 0
123 45
123 45 6
123
and output should be
123 45 6 0
123 45****
123 45 6**... (7 Replies)
Discussion started by: shharrath
7 Replies
3. Shell Programming and Scripting
I have a requirement where I need to add a variable value based on a pattern match. When I try this it works:
sed '/IS_ETL_DEV/a\
ABCD' File1.txt > File1.tmp
Now I want to replace IS _ETL_DEV with a variable like $Pattern and replace the values ABCD with a variable $Var the value "$$XYZ=1".... (4 Replies)
Discussion started by: vskr72
4 Replies
4. Shell Programming and Scripting
im trying to append to the end of the line using sed but I want to do it without creating a new line
the text to which I want to append is all in capital letters.
I want to do something like this:
LINE]Foo
but when I do this:
//a\
] Foo
it prints foo on a new line:
LINE
]Foo
... (11 Replies)
Discussion started by: mrjavoman
11 Replies
5. Shell Programming and Scripting
I am trying to replace in multiple files every instance of text that begins with http and add hyperlink characters to it. I can get it to work with the following:sed -e "s/http*.*/<a href=\"&\">&<\/a>/g" *
as long as the http text is at the end of the file. I need it to stop at the end of the... (2 Replies)
Discussion started by: numele
2 Replies
6. Shell Programming and Scripting
Hi all,
I have a file like
one two three for
five six seven eight
.....
Actually i need to append a label to the words that belong to the 2 column and get:
one two_label three for
five six_label seven eight
....
I was trying with sed inside vim but I can't figure out... (9 Replies)
Discussion started by: Dedalus
9 Replies
7. Shell Programming and Scripting
hi,
anyone can give a sample command on sed. the text file date list belows;
test.txt
"a","bbb",123
"b","ccc",234
"c","eee",456
output i need to add these word "xxx"
"xxx","a","bbb",123
"xxx","b","ccc",234
"xxx" ,"c","eee",456
thanks in advance,
FSP (4 Replies)
Discussion started by: fspalero
4 Replies
8. Shell Programming and Scripting
Hello all,
I want to use sed to append a variable stored in $i, how do i do that?
$i contains a path to a directory and i want to append it before the result i get from awk statement, before affecting awk results.
rite now out put i get from code below is:-
The path is:... (2 Replies)
Discussion started by: asirohi
2 Replies
9. Shell Programming and Scripting
Hi,
I would like to add blank space for fixed length(50) if length of string <30.
Scenario:
File Size
AAA.CSV 123
BB.CSV 134
Expected:
File Size
AAA.CSV 123
BB.CSV 134
I want append blank space until 30 character.
Thanks and Regards,
HAA (1 Reply)
Discussion started by: HAA
1 Replies
10. Shell Programming and Scripting
Hello ,
I have the folloiwing command :
sed -n "$var,$final w $destfile" $sourcefile
where :
$var - $final represent the range of line numbers to be written in $destfile
However I require this command to work in a loop for which i need the sed command to keep appending the output to the... (2 Replies)
Discussion started by: shweta_d
2 Replies