Help with merge data with a reference sequence


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with merge data with a reference sequence
# 22  
Old 07-31-2016
No, it does not, see post #20
# 23  
Old 07-31-2016
Hi Scrutinizer,

It is doesn't matter the line issue on File 1. I can be a line which all words together or I can split the long word into many different line with 100 record each line.

The main concern just hope can replace at correct position of File 1 based on File 2 file provided.

I can split File 1 long file into multiple line without change the word as well.
Sorry for confusing you.
# 24  
Old 07-31-2016
Quote:
Originally Posted by cpp_beginner
[..]
File 2 (3 column and is tab-delimited file)
Code:
Data_1 2 Z
Data_1 3 T
Data_1 10 A
Data_1 11 T
.
.

[..]
File 2 is a file got 3 column (Tab-delimited).
First column is the header description (without ">") of File 1;
Second column is the word to replace in File 1;
Third column is position of word to replace in File 1;
[..]
Which of the two is correct? The sample file and the description contradict each other..
This User Gave Thanks to Scrutinizer For This Post:
# 25  
Old 07-31-2016
Hi Scrutinizer,

Might to know what confuse you now?
Thanks.

---------- Post updated at 10:04 AM ---------- Previous update was at 09:47 AM ----------

I just edited my Post#1.

Hope it no confuse now Smilie
Sorry for my mistake previously.

---------- Post updated at 10:06 AM ---------- Previous update was at 10:04 AM ----------

Hi Scrutinizer,

Sorry for confusing you.
I just edit my Post#1.

Hope it makes thing clear now.

Code:
File 2 is a file got 3 column (Tab-delimited).
First column is the header description (without ">") of File 1;
Second column is the position of word that I wanna to replace in File 1 based on Third column data;
Third column is the word that I wanna to replace it which specific word/specific position of File 1;

---------- Post updated at 10:19 AM ---------- Previous update was at 10:06 AM ----------

Hi RudiC,

Thanks to point out my mistake.
I just edit it.

Sorry to confuse second column and third column description with the File 2 content.
Do you experience to write awk command etc like my case before?

Thanks for advice.
# 26  
Old 07-31-2016
OK, your requirements are clear now..
You need to use a file where the sequence is wrapped along multiple lines...
Quote:
Originally Posted by cpp_beginner
[..]
If I copy and paste the whole command to a file called "run.sh" and execute it as "sh run.sh".
It will still return some Syntax error Smilie

[..]
What syntax error do you get exactly?
# 27  
Old 07-31-2016
Hi cpp_beginner,

please be aware that asking technical questions or requesting help via PM is highly deprecated in these fora. As is bumping up posts...
If your post / request is not answered immediately, that can have multiple reasons, amongst which are unclear specification or data (structures), nobody logged in who can help, or OP not reading / interpreting / understanding proposals correctly and/or not reacting adequately, not reproducing error messages meticulously.

Why don't you take a step back, rephrase your request utmost carefully, supplying input data samples that match your written request (also, when restructuring input, e.g. reduce line length to 100 chars, post a sample), and read and respect all comments carefully. If a proposal doesn't work for you, describe its failure in detail, and post the error messages, as solutions provided usually (>99%) are tested and work with the data given in the environment posted.
This User Gave Thanks to RudiC For This Post:
# 28  
Old 07-31-2016
Hi Scrutinizer,

Glad that it is clear now.
I think I facing Syntax error again Smilie

I try to add semicolon at your code Post@16.
I believe I might missing some semicolon when run your awk command as a single one-liner at my terminal.

Might to know what is the best way I can try it out with your awk command?
Normally I will run the awk command at terminal straight away.

Thanks.

---------- Post updated at 11:18 AM ---------- Previous update was at 11:16 AM ----------

Thanks, RudiC.
Sorry to break the forum rules Smilie

I will take note in future.
I'm going to edit my Post#1 as what you suggested previously.
Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract data using a reference

Gents, If there the possibility can to extract data using a reference from other file. input.txt ( big file which contends all data output.txt ( data extracted ) selection.txt ( information to extract the data Example In file input.txt there is big data each record have 56 lines like... (3 Replies)
Discussion started by: jiam912
3 Replies

2. Shell Programming and Scripting

Compare data with reference from other file

Gents, Please can you help with this. I have a big file (file2) which contends many records increment every 25 rows ( column 1 ). Then I have other file as reference (file1).. column 1 to 11. I want to compare that all values in file2 (column 2 to 12.) match with values in... (2 Replies)
Discussion started by: jiam912
2 Replies

3. Shell Programming and Scripting

Replace a value using a reference data from other file

Gents, Can you please help me to solve this case In my input file I have a values in column 49 which always need to be one, but sometimes the system create a value 2, in this case I need to go to search in the original file and replace the values in the row where the value 2 is and in the... (6 Replies)
Discussion started by: jiam912
6 Replies

4. Shell Programming and Scripting

Merge 2 files with one reference columns

Hi All Source1 servername1,patchid1 servername1,patchid2 servername1,patchid3 servername2,patchid1 servername2,patchid2 servername3,patchid4 servername3,patchid5 Source2 servername1,appname1 servername1,appname2 servername1,appname3 servername2,appname1 servername2,appname2... (13 Replies)
Discussion started by: mv_mv
13 Replies

5. Shell Programming and Scripting

Retrieving sequence data from other file

Hello experts :cool:, I am new to programming and will need your help.. I have 2 very large files with the following format: FILE1: >MLP1019 PL4 >MLP7456 PL3 >MLP9268 PL9 >MLP6245 PL1 FILE2: >MLP1019 STNAPLQTSNTWVSYQPSMMMSLQ >MLP7456 PPYWYWNSAVMIFYVQPLSLLAVLLA >MLP9268... (2 Replies)
Discussion started by: narachaid
2 Replies

6. Shell Programming and Scripting

Help with checking reference data frequency count

reference data GHTAS QER CC N input data NNWQERPROEGHTASTTTGHTASNCC Desired output GHTAS 2 QER 1 CC 1 N 3 (2 Replies)
Discussion started by: perl_beginner
2 Replies

7. Shell Programming and Scripting

Reference data check for delete

Dear All, I have a master file - Master.txt 100|ABC 200|CED 500|XYZ 800|POL I have a reference file - Ref.txt 200 800 What is desired.. Check for all those records in reference file matching with those within master file and then delete those records from Master file So, at end,... (1 Reply)
Discussion started by: sureshg_sampat
1 Replies

8. Shell Programming and Scripting

perl merge two files by the time sequence

Hi Guys, i have two files: fileA: 20090611 00:00:11 20090611 00:00:11 20090611 00:00:24 20090611 00:01:10 20090611 07:13:00 fileB: 20090611 00:00:01 20090611 00:00:12 20090611 00:00:24 20090611 00:01:12 20090611 09:13:00 want to make two files into a single file, but follow the... (14 Replies)
Discussion started by: jimmy_y
14 Replies

9. Shell Programming and Scripting

How to extract data from BNC xml with reference brackets?

I have data like the following pattern: <change date="2000-01-09" who="#OUCS">Updated all catrefs</change> <change date="2000-01-08" who="#OUCS">Manually updated tagcounts, titlestmt, and title in source</change> <change date="1999-09-13" who="#UCREL">POS codes revised for BNC-2; header... (14 Replies)
Discussion started by: Johnivy
14 Replies
Login or Register to Ask a Question