sed find line and replace a spacific character in the last 7 characters

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


sed find line and replace a spacific character in the last 7 characters



I would like to replace a space character in the last seven characters of a line
that starts with the following pattern: "start-string"


"start-string"



Example of the file content :


randomdata 33243as4a4S3342as3A4S3A3s13aw38q363s4 sd7asd312vff74 41g5rfg45f5d3q

start-string 4d d5f5d4fd4f5g6r fgdf dhfhdgnmasj 32121fdfdf21g 45s6g76t2 20



I need to replace the last space character of the line that starts with "start-string" and leave the other line as it is with no edit in the file.


"start-string"



Another question - how can I combine more than one regex command in sed?





Welcome to SO. This site is not a code-writing service and is not meant for delivering complete solutions. Users are expected to show some effort and code whilst SO is here to help you solve specific programming problems along the way. Have you tried anything already? Please read: stackoverflow.com/help/asking
– Maciej Jureczko
3 hours ago









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Arduino Mega cannot recieve any sketches, stk500_recv() programmer is not responding

Visual Studio Code: How to configure includePath for better IntelliSense results

Future solutions