I would like to replace a specific line range with Nan values. My line range is defined by variables for the first and last line I would like to replace, so for example:startrow=3endrow=6Input file:14326134Desired output file:14NanNanNanNan34I think this should be possible using sed. Help much appreciated!
Replace line range, defined by variable, with a string
sed
You can use startline,endlineCOMMAND syntax with sed. For example:$ sed ${startrow},${endrow}s/.*/Nan/ file.txt