I'm back at this after some bench work, and it's not working for me yet.
here's a file named infile
I also tried a version without the initial ">" symbol, in case that had an inappropriate meaning.
here are three main versions of the sed script I'm trying to run, along with variants. I'm using the g command rather than the individual replacements because the replacement value will always be the same. Two of the versions are an attempt to figure out what sort of brackets to use when using numbers rather than dots. The final, clunky version uses the dots.
version 1
version 1a
version 1b
version 2
(same variants as with version 1)
version 3
(same variants as with version 1)
the resulting error is sometimes along the lines of command not found, other times the error says unbalanced parentheses.
desired output would be
to give you a sense of the magnitude of the real program, here's the proposed script for the entire piece of DNA (which would be applied to about 60 lines of that length, rather than the two lines in the infile example.
I'm using a MacOS X default (Bash shell) terminal.
Is there anything I am doing right?
Is there something dead obvious that I'm doing wrong?
I need to write, oh, 18 scripts of this length, and get them working.
---------- Post updated at 03:16 PM ---------- Previous update was at 03:14 PM ----------
I missed two replacements in the sample output file
Hi group,
I want to replace the occurance of a particular text in a paragraph.I tried with Sed,but Sed only displays the result on the screen.How can i update the changes in the original file???
The solution should be a one liner using awk and sed.
Thanks in advance. (5 Replies)
Hey all, Im trying to write a script on windows, which Im not too familiar with. Im generally a bash scripting guy but am using perl for this case.
My question is...
I have this exact output:
2 Dir(s) 6,380,429,312 bytes free
and I just need to get the number out... (4 Replies)
Hi All,
So I found a simple sed command to replace text in a file (http://www.labnol.org/internet/design/wordpress-unix-replace-text-multiple-files/1128/):
sed -e 's/OLDtext/NEWtext/' -i file(s)
Because I'm lazy and don't want to remember this each time I want to do this, I wrote the following... (4 Replies)
Hello All,
I am trying to clean up a poorly looking awk command. I am searching for a way to define a range of positional parameters. I may not be searching for the correct syntax.
Example:
awk ' /14:3*/ {print $2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13}' app.log
Is it possible to shorten... (4 Replies)
I have a simple txt files that looks something like this (The title is a part of the text file)
Student Grades
---------------
1 Tim Purser 89
2 John Wayne 56
3 Jenn Hawkins 95
4 Harry Potter 75
Here are my questions:
How would I ONLY print the names of students... (2 Replies)
HI guys,
Could you help me writing a simple version control script for a text files.
the format could be
./version_control <file(s)> (I want it to be able to work with more than 1 file at the same time)
commands are add and get, add means you add new file(s) to the archive, get means you... (4 Replies)
Hello, I have a comma seperated data sheet with multiple fields of biological data. One column contains the ID name of the sample, where there could be more than one sample separated by a comma. I would like a script that reads this field, and for each sample ID, copies the entire line and writes... (18 Replies)
I have some time series data that I need to resample or downsample at some specific time intervals. The firs column is time in decimal hours. I am tryiong to resample this data every 3 minutse. So I need a data value ever 0.05. Here is the example data and as you can see, there time slot for 0.1500... (3 Replies)
Hi guys,
I worked for almost a half-day for the replacement of some text automatically with script. But no success.
The problem is I have hundred of files, which need to be replaced with some new text. It's a painful work to work manually and it's so easy to do it wrong.
For example,
I... (2 Replies)
Hi all,
Saying we have two files:
1. A "Reference File" whose content is "Variable Name": "Variable Value"
2. A "Model File" whose content is a model program in which I want to substitute "VariableName" with their respective value to produce a third file "Program File" which would be a... (4 Replies)