ARTICLES

find and replace character in file

Nick September 27, 2002 at 07:57:51 Pacific
Unxi, 256

Hi,

I am new to Unix and I need your help. I have the following input file:

2342314.ABO.PR.TO
9937.UIT.PR.N
36924946.CC.ER.TO
3234AQ.UR.U

I need a script to replace the first dot with a comma.

Thanks.



Google Ads

#1
+1
ASB September 27, 2002 at 10:03:56 Pacific

Try:
sed '1,$s/\./,/' Input_file > Output_file
mv Output_file Input_file


Start New Discussion Reply to Message Icon
Related Posts

« comparing dates from a fi... expr & floating point »


This post is quite old and has been locked from receiving new replies. Please create a new posting instead.



Ask the Community!
Describe your Problem
Example: Hard Drive Not Detected on My PC


Google Ads



Results for: find and replace character in file

Replace characters in file names www.computing.net/answers/unix/replace-characters-in-file-names/6079.html

Search and replace string in files www.computing.net/answers/unix/search-and-replace-string-in-files/7857.html

Find and replace with sed or awk www.computing.net/answers/unix/find-and-replace-with-sed-or-awk/8099.html