Hi All,
I have 4 files in below format. I took them as an example.
File 1: Cut from position 1-4 then 6-7 then 8-14 then rest left and make them as columns in one new file. Inserting character H to the initial of all line like HCTOT.
CTOT 456787897 Low fever
CTOR 556712345 High fever
File 2: Cut from position 1-4 then 6-7 then 8-14 then rest left and make them as columns in one new file. Inserting D as initial.
CTWE 456711111 Some Risk
CTWR 551124567 High Risk
File 3: Cut from position 1-4 then 6-7 then 8-14 then rest left and make them as columns in one new file. Insert L as initial.
CTRE 459754125 Doctor Required
CTEE 559754214 Home Sickness
File 4: Cut from position 1-4 then 6-7 then 8-14 then rest left and make them as columns in one new file.Insert M as initial.
CRRE 458757845 Hospital Required
CREE 558757812 Hospital Not required
Column 2 become common column in all 4 files.
Its easy to cut columns usind cut -c command and insertion using sed command but not get the desired output while merge them as columns. I used paste command for that but while pasting I see one blank column in between two columns like CTOT<space><space>45.
I would see my output as:
HCTOT 45 6787897 Low fever
DCTWE 45 6711111 Some Risk
LCTRE 45 9754125 Doctor Required
MCRRE 45 8757845 Hospital Required
HCTOR 55 6712345 High fever
DCTWR 55 1124567 High Risk
LCTEE 55 9754214 Home Sickness
MCREE 55 8757812 Hospital Not required
I used sorting after that and combined all my logic into a shell script but I didn't get the desired output. Please help me out.
Thank you.