emacs - Format Data: Make Columns to Rows (and other way around) -
consider case: have data looks this:
1.9170000e+03 $ 1.6909110e+00
1.4550000e+03 $ 1.7775459e+00
1.1800000e+03 $ 1.8771469e+00
1.0000000e+03 $ 1.9992190e+00
8.7500000e+02 $ 2.1938025e+00
7.8300000e+02 $ 2.5585915e+00
note dollar sign separating 2 column may character (ranging number of spaces, \t (tab) char, comma or character uniquely used purpose of separating column. note data may have more 2 columns.
now i'd reformat block of data such items column listed in single row (separated char marked $ in above example): items column 0 fill row 0, items column 1 fill row 1 , on.
is there predefined emacs function that? or if not, there "self-rolled" function achieve that?
also i'm interested in function reverse thing, i.e. take lines , put them in column structure.
any appreciated!
you can use csv-mode
(available package.el
). simple transpose operation. customize value of csv-separators
'("$")
, use c-c c-t.
Comments
Post a Comment