Can anyone help with a sed command?

I have data that I need to "massage" in order to correct it prior to sending to be processed.

Below is 1 record of many.

0000011800000000159426750146341107193523234406252002AV765156210 45330 FLME0083489G56109FLME0083489G5610900000000000000000000000000000000066000000000000000000000000000000000000660200

There is a ^M at the end of every record.

The data within the record that I need to change is:

FLME0083489G56109FLME0083489G56109

Where I want to change the G56109 to be replaced with blank spaces. This pattern is located 2 times in each record with FLME####### preceeds the data I want to change.

I know the exact position in each line that I want to either take out or change. I just don't know what would be the easiest route to take.

Could I perform a "cut" of the file and possibly "paste" in 6 blank spaces that I need in the 2 different places? Or is there a "sed" command that would be more efficient?

Any help is certainly apprecaited.

I would just use:

sed 's/G56109/      /g'

Thanks for the reply.. but.. that won't help. The G##### is simply a pattern that falls precisely in the file. If the numerical values associated with G remained constant then your command would work for me.

If there was a command where I could search for FLME and once I found FLME within the data line, I could change the data in positions 8-13 AFTER encountering FLME to contain six blank spaces, that would work, just don't know the command.

I do know the position of the data in each record that I want to change to spaces. They are 225-230 and 242-247. I thought of cut and paste but am not sure exactly how to paste 6 blank spaces in the line at those positions. UGH!!!

Well then, how about:

sed 's/\(FLME.....\)G...../\1      /g'

I may have the exact number of dots wrong, but you get the picture.

I tried that code... but I am missing something.

Here is a pasting of several records.

0000011800000000001726552283540814193623235106202002A787917879956210 45380SG FLME0035909D85671FLME0035909D8567100000000000000000000000000000000071500000000000000000000000000000000000715200 AS10 0000011800000000001826314494930424191513230806142002A2113 2809 78321 45385SG 45384SG 4538059SG43235SG FLME0083489G56109FLME0083489G5610900000000000000000000000000000000280600000000000000000000000000000000002806200 AS10 0000011800000000001926346732241224193313244204122002A2113 45385 FLME0015393D54571FLME0015393D5457100000000000000000000000000000000067500000000000000000000000000000000000675200 AS10

You will notice that the data I need to change varies.. it could start with a G or a D or even an E or possibly some other variable. Is there a way to just simply replace those positions in the file with blank spaces? Im missing something.. and I know it's right in front of me..

If the G is not constant data, replace the G with a dot in my sed statement.

This is the results I get.

1$ sed 's/\(FLME.......\)......\1 /g' < ahca.rpt > me

sed: 0602-404 Function s/\(FLME.......\)......\1 /g cannot be parsed.

Take another look at my post. I have a 3 character sequence... /\1
slash
backslash
one

You have dropped the slash and you only have...\1
backslash
one

Put that slash back in. And if you would cut and paste stuff like this wouldn't happen.