If it is literally a replace of the full stop character with NA, then you could try:-
It may not work if:-
Your file has long lines over 2048 bytes,
Your file is very large so it runs out of temp space with the edit,
Your operating system version of vi is a bit different to mine, or
I've missed the point
It is likely that sed could do it better, but I'm not a good writer. If you don't mind it being slow, you could also try (in korn shell):-
Be aware that you cannout write to the file you are reading from. This could be rather slow if you are reading in a large file.
I hope that this helps, but like I said, a sed would probably be better.
because dot has a special meaning when interpreted as a regular expression it means 'any single character' so it needs to be "escaped" using the backslash
thanks! One more question: if I want only replace the dot in a certain column, saying 3rd column, how to do that? sorry, I am new to unix. Thanks again!
I need to replace all filesnames in a folder as well as its content from AK6 to AK11. Eg Folder has files AK6-Create.xml, AK6-system.py etc.. the files names as well as contents should be changes to AK9-Create.xml, AK9-system.py etc
All files are xml and python scripts.
---------- Post... (0 Replies)
I want to replace string values from a file to a file
For eg : File1 has 30 lines of string with values, those specific values needs to be changed in file2 and remaining values in file2 should be as it is.
For example:
From file (File1)
cluster.name=secondaryCluster
To replace File... (9 Replies)
Hi All,
I am facing an issue... I need to replace some string in a text file while the same file is read by some other user at the same time. The other user is using it in the Read only mode. So I can't create a temporary file and write the content first and then write it back into the original... (2 Replies)
I have following set of dirs:
/dir1/dir2/subdir1
file1
file2
/dir1/dir3/subdir1
file4
file5
/dir1/dir4/subdir1
file6
file7
All of these files have a common string in them say "STRING1", How can I... (3 Replies)
Hi,
I need to convert tab delimiter to #*# in txt file.
Does anybody know how to do it?
If i'm using: tr -s '\t' '#*#' < name.txt > name_new.txt
It converts only to #, but I need 3 chars.
Thanks a lot. (2 Replies)
Hi there,
I have a paramater file that looks like this :-
IRL|07122005|27389|VTIEpay|email address|5|200
When my program finishes I want to replace the seventh field. the existing code is like this
cat <<-EOF | ed -s $PARFILE
1,$ g/^$ICO/s/$prvdate/$TODAY/
1,$... (13 Replies)
Hi all,
I need to replace string in XML file..XML file like
<dependency>
<groupId>fr.orange.portail.ear</groupId>
<artifactId>_AdminServicesEAR</artifactId>
<version>1.0.0-20080521.085352-1</version>
<type>ear</type>
</dependency>
<dependency>
... (2 Replies)
Hello,
I am trying to replace a string with a paramter given along with the script.
I am replacing application1 to application2 with the script:
./change_app.sh application2
change_app.sh:
#!/bin/ksh
grep $1 applications.dat 2>&1 >/dev/null
echo $1
file=pckage.new
sed 's/Name:... (5 Replies)
Hello
im trying to redirect the standard output into txt file but with combination of string
if I do :
date >! foo.txt
there is no problem and im getting the date into the foo.txt
but what should I do if I like to add string in the same command so the result will be in the txt : The date... (2 Replies)