chat-miner icon indicating copy to clipboard operation
chat-miner copied to clipboard

Unknown String format

Open bloodyburger opened this issue 2 years ago • 3 comments

While trying to parse a chat exported from a Phone in India,

raise ParserError("Unknown string format: %s", timestr) dateutil.parser._parser.ParserError: Unknown string format: 7.9.2020

bloodyburger avatar Jun 30 '22 10:06 bloodyburger

Is this the full error message? Unfortunately, I could not reproduce the issue with the information provided. I tested successfully with this chat log:

7.9.2020, 11:23 - Author A: Message A 7.9.2020, 11:24 - Author B: Message B

joweich avatar Jun 30 '22 19:06 joweich

here it is

WARNING:chatminer.chatparsers.WhatsAppParser.2215361640912:Can't infer dateformat.                 No message with day > 12. Assuming day first.
Traceback (most recent call last):
  File "c:/Users/Documents/Projects/chat-miner/analyze.py", line 4, in <module>
    parser.parse_file_into_df()
  File "c:\Users\Documents\Projects\chat-miner\chatminer\chatparsers.py", line 28, in parse_file_into_df
    parsed_mess = self._parse_message(mess)
  File "c:\Users\Documents\Projects\chat-miner\chatminer\chatparsers.py", line 88, in _parse_message
    datetime = datetimeparser.parse(mess.split('-', 1)[0],
  File "C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\dateutil\parser\_parser.py", line 1374, in parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "C:\Users\AppData\Local\Programs\Python\Python38\lib\site-packages\dateutil\parser\_parser.py", line 649, in parse
    raise ParserError("Unknown string format: %s", timestr)
dateutil.parser._parser.ParserError: Unknown string format: 7.9.2020 AAAA

bloodyburger avatar Jul 01 '22 03:07 bloodyburger

Would you mind copy-pasting 2-3 anonymized lines from your chat logfile? I can't infer the formatting of your messages from the error message unfortunately.

joweich avatar Jul 01 '22 19:07 joweich