Tuesday, March 25, 2008

Quick way to parse Spoolfile text in Excel:

If you want to parse spooled file rows, such as "Employee Number Pay Rule Hours Worked" into separate columns, you don't need to use fancy formulas. Excel has a tool that makes the job a snap. It is needed only to use the Excel's Text To Columns feature.
Here's how it works:
First, select the column of cells that contains the raw data, and then open the Data menu and choose Text To Columns. When you do, Excel launches the Convert Text To Columns Wizard.
Choose the type that best describes the data and click Next, if you choose Delimited radio button, activate the check box for Space (deselect Tab, which is the default selection), since the delimiter in most cases is simply the space between the number and the label. If you choose "Fixed width", you have the opportunity to move, create or delete break columns.
You can click the Next button if you want to read the next Wizard screen. When you do, Excel will convert the tokens into separate columns and the numbers will be stored as values. You can also click the "Advanced button" to define the decimal and thousand separators and to define that the trailing minus is for negative numbers.

No comments: