This works: But when I try to sort the the filenames, remove the newline the list of filenames that are piped to cat look identical to the previous but sorted: However cat returns this error: Answer Your xargs statement is expecting null terminated entries. If your filenames or directories have spaces, then yes, use the null terminated way.
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
Why does dollar not match literal dollar when extended regex (ERE) option is used with sed?
I want to replace $foo with bar. This works fine. But this command does not work fine when I use the -r option. Why doesn’t this work. Here is an example of what works with -r option. The real question is: Why does $ need to be escaped only while using the -r option. What would $ mean otherwise with
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