2 ms·
rather than try to convince sed to match your corrupt line via regexp, just use awk to split the file into 2 pieces - the lines before the corrupt line (into fi
by finnh 13y ago
rather than try to convince sed to match your corrupt line via regexp, just use awk to split the file into 2 pieces - the lines before the corrupt line (into file A) and the lines after the corrupt line (into file B).
Then cat the 2 files together, with your fixed line in the middle:
cat A > fixed.xml
echo "my fix" >> fixed.xml
cat B >> fixed.xml
- alexkus 13y agoThat was my original suggestion (awaiting moderation):- head -35185221 infile.xml > tmp.xml echo "<load address=’11c1385b’ size=’08’ />" >> tmp.xml tail -n +35185223 infile.xml >> tmp.xml