Skip to content
Advertisement

Tag: sed

Replace very near word to a number with another word [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 6 years ago. Improve this question Replace very near string to a number with another string How to replace

how to replace decimal in linux

I have a csv file with error in one field, the fields are separated by “,” but the error is in decimal field, for example 34.25,” i need replace by 34.25″,”. Search ,” and replace by “,” is not option, others fields will modified. Answer Check that the character before ,” is not a double quote, and if it’s not,

How can I extract the text portion of a binary file in Linux/Bash?

I have a binary file. If I open it with vi, it shows sequences of human-readable text and binary characters. What is the best way to extract the human-readable portion only using Bash? I was thinking, maybe we can do this over a grep or sed pattern? Answer Use the strings utility – that’s exactly what it’s designed for.

Bash: transform key-value lines to CSV format [closed]

Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 6 years ago. Improve this question Editor’s note: I’ve clarified the problem definition, because I think the problem is an interesting one, and this question deserves to be reopened. I’ve got

How Do I Fix This SED Command to Find & Replace a String

Good-day, I’m working on a Bash script for Debian Jessie and in this line; I am trying to find base_dir}/scripts and replace it with script_dir} so that my new line will read as: This is what I have tried so far; which results in this error; I am confused as to how to resolve this and would appreciate some assistance

linux sed reads whole file when only editing first line

I am currently working with CSV files that can be 10’s of GB in size, and need to edit the headers dynamically depending on the use case. For this I am using: which has the desired effect of only editing the headers, but can take upwards of 10 seconds to complete. I imagine this is because the whole file is

How can I extract text from between two xml tags using sed

I have the following output from curl: How can I retrieve the text between <id> and </id>? I tried using: but that results in the entire block of text being printed out instead of just the part between and <id>. I don’t have the ability to install programs on this box so I’d rather not go through the hassle of

Extract text with any command in linux shell

How do I extract the text from the following text and store it to the variables: Here, I want to store 05 in one variable, 21 in another, 09 in another and so on. All the value must me stored in array or in separate varibles. I have tried: I need a more clear solution or short solution. Answer Your

Advertisement