Question: Command prompts combination
0
gravatar for K.Gee
9 days ago by
K.Gee10
K.Gee10 wrote:

Hello! I have some "weird" txt.files and I found this way to manipulate them.
I use in combination csplit (generates couple of txt files) and join to obtain my desired output. My question is: Is it anyway to combine them in one command?

Im giving you my commands.

csplit -z qrna_ref.txt /AA_QUERY/ {*} -f area.txt  --> generates in this case 4 files named area.txt

join -a1 area.txt00  area.txt01 |join - area.txt02 |join - area.txt03 | join - area.txt04

I tried csplit -z qrna_ref.txt /AA_QUERY/ {*} -f area.txt && join -a1 area.txt00 area.txt01 |join - area.txt02 |join - area.txt03 | join - area.txt04 but it doesnt work...

Thanks in advance!

linux • 107 views
ADD COMMENTlink modified 9 days ago by tomc80 • written 9 days ago by K.Gee10

It is not clear what you are saying here, the commands do work separately but not when giving the command together?

In what way does it not work?

Do one step at a time, see if you can get it to work - most importantly the files need to be sorted by the field that you join on.

ADD REPLYlink written 9 days ago by Istvan Albert ♦♦ 82k
0
gravatar for tomc
9 days ago by
tomc80
United States
tomc80 wrote:

'join' is oriented to match columns within a row (as 'join' in relational databases), not to concatenate chunks of rows as you have here. for that use 'cat'

cat area.txt0* > out.txt

ADD COMMENTlink written 9 days ago by tomc80
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1216 users visited in the last hour