Tab-delimited file problems |
Top Up Down
A A |
Question: I'm having trouble reading files from SPSS or EXCEL. I save the file in EXCEL or SPSS as a text file and have tried saving in all formats (tab-delimited, comma, etc.). It always saves the data with tabs separating the column values. When I read the file in Winsteps, the tabs are translated into columns, thus producing every other row of empty columns. How do I get around this?
Answer: There are numerous ways round this difficulty.
(a) Use Winsteps to format your SPSS .sav file into a Winsteps file (use the Excel/RSSST pull-down menu in Winsteps).
(b) Use the Winsteps "setup" routine to format your EXCEL data.
Start Winsteps "setup" (Setup pull-down menu in Winsteps)
Copy the cells you want from EXCEL, paste them into the Data area of the Setup screen.
(c) Get EXCEL to write out a file without Tabs: "Save as" a ".prn" file. "Formatted text (space delimited)"
Before you do this, set all data columns widths to 1.
(d) Tell Winsteps the data are Tab separated: use DELIMITER= .... but this is tricky to get to work correctly.
(e) Edit your data file with Notepad. Replace all tabs with nothing. To "find" a Tab, highlight a Tab, copy it (ctrl+C), then paste it into the "find" box: ctrl+v.
(f) Use FORMAT= or MFORMS= to pick up every other column. This is tricky.
(g) Edit your data file with Notepad. Replace all tabs with a space. To "find" a Tab, highlight a Tab, copy it (ctrl+C), then paste it into the "find" box: ctrl+v. Press the space bar in the "replace" box. Use XWIDE=2
Tabs in the Data File |
|
Data file looks like: |
|
Winsteps reports: |
|
Problem diagnosis: |
|
Edit the data file in NotePad |
|
Highlight a tab with the mouse |
|
NotePad Edit menu: Copy the tab (Ctrl+c) |
|
NotePad Edit menu: Replace (Ctrl+h) |
|
Find what: Ctrl+v (Paste)
Box character is a Tab |
|
Replace with: |
|
Replace All (This can be slow) |
|
After Replace All |
|
Save the data file: Ctrl+s |