12-11-2003
"that begins with a 0"
i guess it should be
sed 's/^0...../******/' file1 > file2
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Can we replace the contents the of the rows of file, from one position to another position by mentioning, some start position & the width? (4 Replies)
Discussion started by: videsh77
4 Replies
2. Shell Programming and Scripting
Hi,
I have a file with data like below
a}hasksd09090}kdkdkd
aksdkdkdk787}08ksapodd
asl}alks13233}dsjskdkd
I need to replace any '}' to 0 if it appears in 10 to 15 postions.If } appears in any other postion I need to leave it.
So for the above data , output should be
a}hasksd090900kdkdkd... (1 Reply)
Discussion started by: dncs
1 Replies
3. Shell Programming and Scripting
Hi all,
I need your help.
For example I have string in file.txt:
-x -a /tmp/dbarchive_NSS_20081204 -f 900 -l 1 2008/12/04 2008/12/04
So, I need to replace symbols from (for e.g.) position 26 till 33 with symbols which I have in file replace.txt
And I have no idea how to do it.
If... (1 Reply)
Discussion started by: nypreH
1 Replies
4. Shell Programming and Scripting
I want to remove text from nth position to nth position couple of times in same line
my line is
"hello is there anyone can help me with this question"
I need like this
ello is there anyone can help me with question
'h' is removed and 'this' removed from the line. I want to do this... (5 Replies)
Discussion started by: elamurugu
5 Replies
5. Shell Programming and Scripting
I'm drawing a blank on how to use sed to replace selectively based on position in the string (vs nth occurence):
hello.|there.|how.|are.|you.|
I want the period removed in the 3rd item (as defined by the pipe delimiter) if a period is present. So the result in this case would be:
... (2 Replies)
Discussion started by: tiggyboo
2 Replies
6. Shell Programming and Scripting
I asked this before, but my problem got more complicated. Heres what I am trying to do:
I'm trying to replace a string at a certain location with another string.
Heres the file I'm trying to change:
\E
I want to replace the escape code at the 3rd line, 2nd column with this escape code... (3 Replies)
Discussion started by: tinman47
3 Replies
7. Shell Programming and Scripting
Hello everyone!
I'm having some problems trying to translate a text file.
I've found some TR and SED commands but doesnt work exactly as I need.
The point is:
1. Replace all the letters with accent of a text file, like this: Ã>A Á>A Õ>o
2. Replace all the special characters with a... (3 Replies)
Discussion started by: ulysses2703
3 Replies
8. Shell Programming and Scripting
hi,
can someone tell me how can I translate the following line from sed to awk?
`sed 's/^*:*:*:*:*:\(*\):.*/\1/
How to use code tags when posting data and code samples. (14 Replies)
Discussion started by: adam25bc
14 Replies
9. Shell Programming and Scripting
Hi there script guru's
I have an input file /tmp/in.txt of which the data is seperated by a : (example of the data)
test1:zz:2000:2000:zzz
te:a:2000:3333:bbb
testabs:x:2004:3000:cccc
I would like to run a scrip (bash) changing the data after the second ":"
example
Test for the value of... (3 Replies)
Discussion started by: KobusE
3 Replies
10. UNIX for Beginners Questions & Answers
Hello,
I have never ever seen below notation for string substitution.
sed -i -e 's/tttt/pppp'/g /var/bin/czech.sh;
The strange thing for me is the position of the apostrophe. Should it be before the / or after the g?
If I had been writing that command line, I would have chosen below way:... (3 Replies)
Discussion started by: baris35
3 Replies
LEARN ABOUT DEBIAN
pod::tree::pod
Pod::Tree::Pod(3pm) User Contributed Perl Documentation Pod::Tree::Pod(3pm)
NAME
Pod::Tree::Pod - Convert a Pod::Tree back to a POD
SYNOPSIS
use Pod::Tree::Pod;
$tree = new Pod::Tree;
$dest = new IO::File;
$dest = "file.pod";
$pod = new Pod::Tree::Pod $tree, $dest;
$pod->translate;
DESCRIPTION
"Pod::Tree::Pod" converts a Pod::Tree back to a POD. The destination is fixed when the object is created. The "translate" method does the
actual translation.
For convenience, Pod::Tree::Pod can write the POD to a variety of destinations. The "new" method resolves the $dest argument.
Destination resolution
"Pod::Tree::Pod" can write HTML to either of 2 destinations. "new" resolves $dest by checking these things, in order:
1. If $dest is a reference, then it is taken to be an "IO::File" object that is already open on the file where the POD will be written.
2. If $dest is not a reference, then it is taken to be the name of the file where the POD will be written.
METHODS
$pod = "new" "Pod::Tree::Pod" $tree, $dest
Creates a new "Pod::Tree::Pod" object.
$tree is a "Pod::Tree" object that represents a POD. $pod writes the POD to $dest. See "Destination resolution" for details.
$pod->"translate"
Writes the text of the POD. This method should only be called once.
DIAGNOSTICS
"Pod::Tree::Pod::new: not enough arguments"
(F) "new" called with fewer than 2 arguments.
"Pod::Tree::HTML::new: Can't open $dest: $!"
(F) The destination file couldn't be opened.
NOTES
o The destination doesn't actually have to be an "IO::File" object. It may be any object that has a "print" method.
SEE ALSO
perl(1), "Pod::Tree", "Pod::Tree::Node"
AUTHOR
Steven McDougall, swmcd@world.std.com
COPYRIGHT
Copyright (c) 2000-2003 by Steven McDougall. This module is free software; you can redistribute it and/or modify it under the same terms as
Perl itself.
perl v5.10.1 2004-10-11 Pod::Tree::Pod(3pm)