9921190625797AE2560 20091001US20091001@@NEWSITE @@ 20091013001X X 01NEW00DNA00007081 @@ SPRINGFIELD @@ @@ NJ US 001 USX
I want to switch the columns and replace certain values into another file. For example, the output file will have the columns in the following order from input file
chars 1-13
chars 81-98 (if input is spaces replace with current date)
chars 14-23
chars 24-31 (if input is spaces replace with "00010101")
....
....
and so forth
I can switch the columns using the below awk script but not sure about replacing the values.
Last edited by rs1969; 08-26-2011 at 08:05 AM..
Reason: minor correction
Can i use sed command to replace certain column in the file
let say i hav
D1254215221542 MANA3DS2OOR454
C1254815221121 MDGA4GH4OOR454
A1254215221522 AFFA4DF4OODS54
S3454815221121 TDTA4GH465R454
I wanted to change only at postition 21 and 22 which is DS,GH,DF and GH
i want find that if... (6 Replies)
hi All,
Thi sis very urgent.
I have large files with pipe delimited.
For example:
1.txt
1001024|120|9|-0.0|#|
1001025|120|9|#|
1001026|120|9|#|
1001032|120|2|-0.0|#|
1002026|110|9|#|
1002027|110|9|-0.0|#|
1002028|120|1|1.0|#|
I need to replace the 4th filed if it is # by |-|
my... (2 Replies)
Hi all,
I would like to replace some columns from file1 with columns from file2. Currently, I'm able to do it with the following command:
awk 'NR==FNR{a=$1;b=$2;c=$3;next;}
{$2=a;$4=b;$5=c;print}' file2 file1 > temp
mv -f temp file1
First, i make the changes and save it as a temp... (1 Reply)
HELLO! This is my first post here! By the way, I think it is great that people do this.
My question:
I have two files, one is a .dilm and one is a .txt. It is my understanding that the .dilm file can be treated as a .txt file. I wrote another program where I was able to manipulate it as if it... (3 Replies)
Hi,
I have two files that are different in size (column #'s differ). Each file has the exact same 3 starting columns. File 1 has 240 columns while File 2 has 45 columns.
So if the first 3 columns are the same, I want to replace columns 83 to 163 from File 1 with columns 18 to 33 from File... (7 Replies)
Hi all,
I have 2 files:
species-names.txt
Abaca-bunchy-top-virus ((((Abaca-bunchy-top-virus((Babuvirus((Unassigned((Nanoviridae((Unassigned))))
Abutilon-mosaic-virus ((((Abutilon-mosaic-virus((Begomovirus((Unassigned((Geminiviridae((Unassigned))))... (2 Replies)
Hi Friends,
I have the following input file
cat input
chr1 100 200 0.1 0.2 na 1 na nd
chr1 105 200 0.1 0.2 1 1 na 98
chr1 110 290 nf 1 na nd na 1
chr2 130 150 12 3 na 1 na 1
chr3 450 600 nf nf na 10 na nd
chr4 300 330 1 1 10 11 23 34
My requirement is
1. If $6 is na make $7 nd and... (2 Replies)
I have two files in below formats:
cat file1
abc|abcd|10|1020
10|xyz|1010|1020
abc|abcd|10|1020
10|xyz|1010|1020
cat file2
abc|abcd|10|1020
11|xyz|1010|1020
abc|abcd|12|1020
10|xyz|1011|1020
abc|abcd|11|1020
10|xyz|1010|1020
abc|abcd|10|1020
10|xyz|1010|1020
I am generating a... (3 Replies)