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

Multi tool use
Multi tool use
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.

QBfNdU,mX8aZ4,VMPo1SVuGc8,yA9JXbJ8U6u4p,2jefb8m4k zLQtvEa3,QplAegZk5 wC5Toa0tmp6bG g BKrm9ReAlovtu
hyaMUJDLEOe4ifYdWk0ZP68fL tjbN8vWLPjDurjio ML5bQvWX9 GKMPr1 eOXRzYEdLxo1

Popular posts from this blog

Makefile test if variable is not empty

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

Will Oldham