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!
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.
Yes exactly. In combination those two commands are not working together. Because the csplit gives an output of 4 files and I was trying to avoid having 4 files as an output and find the way to gave one output file at the end. That was the purpose of my question.
Maybe i didn't specify my question. I was trying to avoid having 4 output files at the end, so I was looking if by combining those 2 commands, so as to have one final output instead of 4. But I get your point. So if I understand what your are saying I should try some like:
csplit -z qrna_ref.txt /AA_QUERY/ {*} -f area.txt ; cat area.txt00 area.txt01 area.txt02 area.txt03 area.txt04 >out.txt
For having one output file?