Solved

removing extra char with sed

Posted on 2011-03-03
2
430 Views
Last Modified: 2012-06-27
Hi,

I am trying to remove the extra 'F0' char from the first field and the leading '3' from the second field of this sample file and wld appreciate some help with sed.
757000300F0,3123456,2010/04/07,13:00:00
757003456F0,314567434,2010/04/07,14:00:00
0
Comment
Question by:nevyana2006
2 Comments
 
LVL 45

Accepted Solution

by:
Kent Olsen earned 500 total points
ID: 35031772
Hi nevyana,

Does the first field always end in 'F0' and does the second field always start with '3'?

If so, perhaps the easiest is:

  sed 's/F0,3/,/' myfile



Kent
0
 

Author Comment

by:nevyana2006
ID: 35031844
Hi, yes they do, thanks
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
When you do backups in the Solaris Operating System, the file system must be inactive. Otherwise, the output may be inconsistent. A file system is inactive when it's unmounted or it's write-locked by the operating system. Although the fssnap utility…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question