I have several large text text files that all have the same structure and I want to delete the first 3 lines and then remove illegal characters from the 4th line. I don\'t w
As wim said in the comments, sed is the right tool for this. The following command should do what you want:
sed -i -e '4 s/(dB)//' -e '4 s/Best Unit/Best_Unit/' -e '1,3 d' yourfile.whatever
To explain the command a little:
-i executes the command in place, that is it writes the output back into the input file
-e execute a command
'4 s/(dB)//' on line 4, subsitute '' for '(dB)'
'4 s/Best Unit/Best_Unit/' same as above, except different find and replace strings
'1,3 d' from line 1 to line 3 (inclusive) delete the entire line
sed is a really powerful tool, which can do much more than just this, well worth learning.