Replace a string within a file.. with help of positions
Thanks a ton for this...
It worked...
But i don't understand how it changed exactly in the same position and not in other positions..
Also i have a requirement... where in i have to do such changes in other positions as well...
So please let me know the meaning behind this... as i wanted to replace certain things.. near 150,225 th position's in each line.. in the file..
Thanks in advance..
Gopi
Last edited by radoulov; 03-02-2011 at 06:52 PM..
Reason: Code tags!
Hi
i am having text file like this
40000201040005200213072009000000700000050744820906904421
40069300240005200713072009000000067400098543630000920442
i want to replace 9-16 positions of my txt file...by 1234567...in a single line command
i.e
0400052....should be replaced by... (2 Replies)
I am attempting to replace positions 44-46 with YYY if positions 48-50 = XXX.
awk -F "" '{if (substr($0,48,3)=="XXX") $44="YYY"}1' OFS="" $filename > $tempfile
But this is not working, 44-46 is still spaces in my tempfile instead of YYY. Any suggestions would be greatly appreciated. (9 Replies)
Can someone tell me how I can do this?
e.g:
Say file1.txt contains:
today is monday
the 22 of
NOVEMBER
2010
and file2.txt contains:
the
11th
month
of
How do i replace the word NOVEMBER with (5 Replies)
I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Script for if characters from positions 7-15 are matching with characters from position 211-219 then replace all char from 211-219 with 9 space.
Total length of record is 420. Here is the specification of the data in file.
Position Field Data Type... (2 Replies)
Hi, I am trying to use an awk command to replace specific character positions on a line beginning with 80 with contents of another file.
The line beginning with 80 in file1 is as follows:
I want to replace the 000000000178800 (positions 34 - 49) on this file with the contents of... (2 Replies)
Hi all, I have column 2 full of values like HIVE4A-56 and HIVE4-56. I want to convert all values like HIVE4A-56 to HIVE4-56.
So basically I want to delete all single alphabets before the '-' which is always preceded by a number. Values already in the desired format should remain unchanged... (4 Replies)
My objective is to replace the 8th, 9th, 10th characters by 1 space per character (total 3 spaces) in a file.
I achieved this using following command:
sed 's/\(.\)/\1@/7;s/@\(...\)/ /' FileData.txt > FileData_UPDATED.txt
Another situation comes when I need to done same but excluding 1st... (5 Replies)
I have a test file a.txt
001 123 456 789
002 This is just a
001 test data
003 file.
I want to clear columns 5 and 6 if the first 3 characters are 001 using awk.
I tried following but does not work. Any suggestions?
awk 'BEGIN{OFS=FS=""} {if (substr($0,1,3)=="123") $5=" "; $6="... (20 Replies)
I have a fixed-length positional file. I am trying to replace content of position 4-13 (length=10) with xxxxxxxxxx.
Sample 2 rows in this file:
H0187459823 172SMITH, JOE
H0112345678 172DOE, JANE
In this example 87459823 (from 1st line) and 12345678 (from 2nd line) (both in position... (3 Replies)
Discussion started by: Diver181
3 Replies
LEARN ABOUT DEBIAN
tigr-extract
TIGR-GLIMMER(1) General Commands Manual TIGR-GLIMMER(1)NAME
tigr-glimmer -- Fine start/stop positions of genes in genome sequence
SYNOPSIS
tigr-extract [genome-file options]
DESCRIPTION
Program extract takes a FASTA format sequence file and a file with a list of start/stop positions in that file (e.g., as produced by the
long-orfs program) and extracts and outputs the specified sequences.
The first command-line argument is the name of the sequence file, which must be in FASTA format.
The second command-line argument is the name of the coordinate file. It must contain a list of pairs of positions in the first file, one
per line. The format of each entry is:
<IDstring>> <start position> <stop position>
This file should contain no other information, so if you're using the output of glimmer or long-orfs , you'll have to cut off header
lines.
The output of the program goes to the standard output and has one line for each line in the coordinate file. Each line contains the
IDstring , followed by white space, followed by the substring of the sequence file specified by the coordinate pair. Specifically, the
substring starts at the first position of the pair and ends at the second position (inclusive). If the first position is bigger than the
second, then the DNA reverse complement of each position is generated. Start/stop pairs that "wrap around" the end of the genome are
allowed.
OPTIONS -skip makes the output omit the first 3 characters of each sequence, i.e., it skips over the start codon. This was the behaviour of
the previous version of the program.
-l makes the output omit an sequences shorter than n characters. n includes the 3 skipped characters if the -skip switch is
one.
SEE ALSO
tigr-glimmer3 (1), tigr-long-orfs (1), tigr-adjust (1), tigr-anomaly (1), tigr-build-icm (1), tigr-check (1), tigr-codon-usage (1), tigr-
compare-lists (1), tigr-extract (1), tigr-generate (1), tigr-get-len (1), tigr-get-putative (1),
http://www.tigr.org/software/glimmer/
Please see the readme in /usr/share/doc/tigr-glimmer for a description on how to use Glimmer3.
AUTHOR
This manual page was quickly copied from the glimmer web site by Steffen Moeller moeller@debian.org for the Debian system.
TIGR-GLIMMER(1)