[Solved] Meaning of an apostrophe before a number

Help with installation and general system troubleshooting questions concerning the office suite LibreOffice.
Post Reply
Pedroski55
Posts: 40
Joined: Wed Aug 31, 2016 2:15 am

[Solved] Meaning of an apostrophe before a number

Post by Pedroski55 »

I am using python to get answers from emails and assign a score to the student. To my surprise, 2017 class 1 and 2 all had zero, whereas classes 3 & 4 has their respective scores.

Checking the start table, I found that, for classes 3 & 4, all the student numbers begin with an apostrophe, like: '1725010301 (Please see the screenshot)
All the student numbers for classes 1 & 2 did not have an apostrophe and no score was inserted in the column next to their number.

I read the email answers into a python style dictionary, studentsScores, then write that to the scores table. The key for each entry is the student number and the value is the score, like {'1725010301', 26, '1725010302', 26, and so on}

When I did

for key in studentsScores.keys():
print(key)

I see no apostrophes.

What is the function of this apostrophe?

I went through my table and inserted an apostrophe before each student number which did not have one, then all the scores were inserted correctly.
Attachments
Screenshot from 2018-10-25 08-56-37.png
Screenshot from 2018-10-25 08-56-37.png (16.42 KiB) Viewed 5292 times
Last edited by Hagar Delest on Thu Nov 01, 2018 5:47 pm, edited 3 times in total.
Reason: Add green tick [robleyd, Moderator]
Libre Office 5 on Ubuntu 16.04
FJCC
Moderator
Posts: 9248
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: the meaning of an apostrophe before a number

Post by FJCC »

The apostrophe is an indicator that the cell content is text, despite looking like a number. The apostrophe is not part of the cell content, it only appears in the formula bar. If you need the content of column A to be text, I suggest you format it as text before entering any data.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Pedroski55
Posts: 40
Joined: Wed Aug 31, 2016 2:15 am

Re: the meaning of an apostrophe before a number

Post by Pedroski55 »

Thank you very much, that cleared that up! It is good because the dictionary key is also text, read from a text file!
Libre Office 5 on Ubuntu 16.04
Post Reply