deleting pipes in a particular filed

i have a file with some records seperated by pipe. I am getting unwanted "|" in the 7th field and i want to remove any pipes in the
7th field only. Can somebody help out? Here is the sample record.

460625192|432559595|MANU MC|2013/12/01||2007/09/24|-R@a{[^U|O?6-\u??^L ?|100|5|Y|||1|9100380020070924|2007/10/10 20:40:21|9999/12/31 01:00:00|Y|54113|OPUS|PLASTIC|X13253U89MCKA|1|2007/10/10 20:40:21

Hi.

How would a program determine that there is an embedded symbol, as opposed to the normal field separator symbol? Is there some unique context in which the embedded symbol appears?

Off-hand, I'd say that this would need to be taken care of when the file is created ... cheers, drl

Hi.

Here is one kind of solution. It depends on accepting that the first line has the correct number of fields, and that all errors ( extra separators ) are confined to a single field. In this example, that's field 3. If an anomaly occurs, then the extra separator is removed.

#!/usr/bin/env sh

# @(#) a1       Demonstrate embedded field separator correction.

set -o nounset
echo

## Use local command version for the commands in this demonstration.

echo "(Versions used in this script displayed with local utility "version")"
version bash awk

echo

# Create data file.

cat >data1 <<'EOF'
now|is|the|time
for|all|go|od|men
to|come|to|the
aid|of|their|country
EOF

# This assumes that if an embedded separator appears, it will be
# in field 3, and so the separator number 3 will be replaced with
# the null string.  This is essentially a trial-and-error
# solution.

echo " Data file:"
cat data1

echo
echo " Results of correction:"
awk '
BEGIN   { FS = "|" }
NR == 1 { f = NF }
        {
                if ( NF != f ) {
                        print " BANG! found discrepancy at line", NR # remove as desired
                        $0 = gensub("[|]","",3,$0)
                }
                print $0
        }
' data1

exit 0

Producing:

% ./a1

(Versions used in this script displayed with local utility version)
GNU bash, version 2.05b.0(1)-release (i386-pc-linux-gnu)
GNU Awk 3.1.4

 Data file:
now|is|the|time
for|all|go|od|men
to|come|to|the
aid|of|their|country

 Results of correction:
now|is|the|time
 BANG! found discrepancy at line 2
for|all|good|men
to|come|to|the
aid|of|their|country

See man pages for details, modify as necessary ... cheers, drl

TRY THIS OUT !!!!!!!!!!!!!!!!!!!!!!!!!!

cut -d'|' -f7,8 filename | tr -d '|'