Message Boards Message Boards

0
|
7954 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

Block/Column selection in Mathematica 9 ?

Posted 10 years ago

Hello everyone,

Is it possible to select text as a block (or column) from a notebook in Mathematica 9? (Meaning selecting whole columns of text without also selecting text to the right or left of the column.) I am currently working with pdb files composed of large amounts of text (an example is given below); I have been using Kate text editor to select blocks of text and then moving them to Mathematica/Matlab where they can be manipulated, before copying the modified text back to the original file again using Kate. It would be extraordinarily convenient if Mathematica could perform all of these tasks without needing a seperate program. I would appreciate any suggestions anyone may have.

ATOM 21 CAL CAL 4 4.712 13.603 10.3082 1.00 0.00 Ca

ATOM 22 CAL CAL 5 8.199 14.309 8.5988 1.00 0.00 Ca

ATOM 24 CAL CAL 6 3.580 10.230 8.5988 1.00 0.00 Ca

ATOM 27 CAL CAL 7 9.424 10.882 13.748 1.00 0.00 Ca

ATOM 28 CAL CAL 8 5.937 10.176 12.038 1.00 0.00 Ca

(Example of text, however the columns are much cleaner and more well spaced in the actual file.)

POSTED BY: Scott Muller
Posted 10 years ago

Hi Scott,

I frequently use Mathematica to process data produced by other tools, and to produce data that can be imported by other tools. Generally, I Import[] the data into Mathematica in some appropriate format. Often I use Import with "Table" as the format. ReadList[] is also useful. There is good control over delimiters in both.

I generally do all processing within Mathematica and export a file which is directly useable by the destination tool. Selecting rows or columns, processing them, and reformatting the data is easy in the Mathematica list-of-lists convention. Export with its various format options is the usual method for outputting tabular data as TSV, CSV, or any other format, including using spaces as word separators.

Best regards, David

POSTED BY: David Keith
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract