I have data in text form which I want to import into excel, re-sort on of the columns (Ascending or Descending order) and then export it back to text. The clolumn width should not change and no spaces should be generated or deleted, otherwise other applications will not be able to read my file. An example of my data -
ATOM 1 HT1 ARG 1 38.208 12.675 16.098 1.00 0.00 G5A
ATOM 2 HT2 ARG 1 37.062 13.111 14.922 1.00 0.00 G5A
ATOM 3 N ARG 1 37.494 13.382 15.829 1.00 45.73 G5A
ATOM 4 HT3 ARG 1 36.758 13.427 16.563 1.00 0.00 G5A
ATOM 5 CA ARG 1 38.127 14.684 15.695 1.00 60.03 G5A
ATOM 10 HE ARG 1 40.240 18.099 16.808 1.00 0.00 G5A
ATOM 50 HE21 GLN 4 36.442 11.675 8.997 1.00 0.00 G5A
ATOM 101 C VAL 9 27.179 20.374 9.433 1.00 12.10 G5A
Above data only appears as if the spaces are different in each line, but in fact they are the same. I need to import this into excel and re-sort it according to the 5th column (descending) and export it again without adding or deleting any spaces.
The field description are -
Position 1-6 should be column 1 (ATOM then two spaces).
Position 7-11 should be column 2 containing integers. (First line has 1 so it should have 4 spaces then 1).
Position 12 is a blank space always, so Column 3 is a blank column with 1 space width.
Position 13-16 has text+numbers (HT1 means one space followed by HT1)
And so on.
Can anyone help me how to create columns of fixed width while importing as well as exporting. I tried space delimited importing by positioning the separator lines exactly where I need, but the spaces are lost after import. I do not care much about import, but the export needs to be in the exact format. Thanks.
Matt
ATOM 1 HT1 ARG 1 38.208 12.675 16.098 1.00 0.00 G5A
ATOM 2 HT2 ARG 1 37.062 13.111 14.922 1.00 0.00 G5A
ATOM 3 N ARG 1 37.494 13.382 15.829 1.00 45.73 G5A
ATOM 4 HT3 ARG 1 36.758 13.427 16.563 1.00 0.00 G5A
ATOM 5 CA ARG 1 38.127 14.684 15.695 1.00 60.03 G5A
ATOM 10 HE ARG 1 40.240 18.099 16.808 1.00 0.00 G5A
ATOM 50 HE21 GLN 4 36.442 11.675 8.997 1.00 0.00 G5A
ATOM 101 C VAL 9 27.179 20.374 9.433 1.00 12.10 G5A
Above data only appears as if the spaces are different in each line, but in fact they are the same. I need to import this into excel and re-sort it according to the 5th column (descending) and export it again without adding or deleting any spaces.
The field description are -
Position 1-6 should be column 1 (ATOM then two spaces).
Position 7-11 should be column 2 containing integers. (First line has 1 so it should have 4 spaces then 1).
Position 12 is a blank space always, so Column 3 is a blank column with 1 space width.
Position 13-16 has text+numbers (HT1 means one space followed by HT1)
And so on.
Can anyone help me how to create columns of fixed width while importing as well as exporting. I tried space delimited importing by positioning the separator lines exactly where I need, but the spaces are lost after import. I do not care much about import, but the export needs to be in the exact format. Thanks.
Matt