Serv: spreadsheet output from DB
Posted by sarneil on 16 Apr 2018 in Academic
File in the /build folder called db_to_spreadsheet.php that creates an approximation of the original spreadsheet with info obtained from various tables in the db.
Outputs a text file called db_to_spreadsheet.txt into the same folder as soon as the page is loaded.
I'm using \t for the field delimiter and \n for the line delimiter.
The character encodings are wobbly.
I'm getting consistent and apparently correct results with either of these methods:
1)
- right-click on View Text File link and save the file as db_to_spreadsheet.txt
- Open file in text editor (tell it the file is Latin_windows_1 encoding), then set the character encoding on the file to UTF-8, save file.
- in Excel, Import as text file, set character encoding to UTF-8, choose "delimited" not "fixed width", choose tab as delimiter character.
2)
- click on the View Text file link, see the text in the browser window.
- select text in browser window, copy
- open text editor, paste text in, ensure character encoding is UTF-8 and save file
- in excel, Import as text file, set character encoding to UTF-8, choose "delimited" not "fixed width", choose tab as delimiter character.