Import fixed-width column text document in OpenOffice.org Calc
I have a problem, our software produces reports that is formated in fixed width columns, it does not have an option to genereate csv or other delimited format. I didn't find a way to import such a document in OpenOffice.org Calc. MS Excel does this very well and we are using it at the moment, but we are considering to change to Linux. Is there any way?
|
I don't know how to do it inside of OpenOffice, but here
is a simple shell script that will do it. Quote:
Use chmod +x fixed2pipe.bash using the original fixed data file called fixedwidth.dat, the output file will be called fixedwitdh-pipe.dat, Run the command like this ./fixed2pipe.bash fixedwidth.dat The original file looks like: AAAbbbCCCCddddddddddEEEEEEEEEE aaaBBBccccDDDDDDDDDDEEEEEEEEEE The new file has: AAA|bbb|CCCC|dddddddddd|EEEEEEEEEE aaa|BBB|cccc|DDDDDDDDDD|EEEEEEEEEE which can load easily into OpenOffice. |
Several ways
1. Rename document to .csv and open in OpenOffice.org (which will go to Calc) 2. Copy to clipboard and paste into Calc 3. Use Text to Columns All three options give you the same dialog which allows fixed or delimited width import. |
Number two showed to be most usefull. You just have to click up between columns to separate them in proper way. Thank you for this help!
|
All times are GMT -5. The time now is 02:03 PM. |