Hello,
I have a directory with allot of tab delimited text files that have data that look like,
filePath distance
(1,4-dioxan-2-ylmethyl)methylamine 0.0
4-methylmorpholine 0.0755473632594
1-propyl-4-piperidone 0.157792911954
heptaminol 0.158142893249
N-acetylputrescine 0.158689628956
spermidine 0.170417125303
for simplicity, I have include the first 7 rows of the file, but there are 25.
I need to sort through these and extract the string at column 1 row 2 and column 2 rows 3 through n. I then need to transpose this data so that there is one row for each input file.
For the data above, the row would look like,
(1,4-dioxan-2-ylmethyl)methylamine 0.075547363 0.157792912 0.158142893 0.158689629 0.170417125
There are many files, so if the second input file was,
filePath distance
(1-methyl(4-piperidyl))(3-pyridylmethyl)amine 0.0
lidocaine 0.0971033747257
methoxyphenamine 0.106031307815
meperidine 0.107826404718
fenspiride 0.118603492524
tetracaine 0.122268535847
The output for both files would look like,
(1,4-dioxan-2-ylmethyl)methylamine 0.075547363 0.157792912 0.158142893 0.158689629 0.170417125
(1-methyl(4-piperidyl))(3-pyridylmethyl)amine 0.097103375 0.106031308 0.107826405 0.118603493 0.122268536
I'm guessing that it could be done with awk, but I have never transposed columns before. My alternative is excel, so suggestions would be appreciated. I have about 1500 files to sort through, so this will take a while if I can't get something automated.
thanks,
LMHmedchem