Skip to content

Instantly share code, notes, and snippets.

@ninadpchaudhari
Created June 19, 2026 17:07
Show Gist options
  • Select an option

  • Save ninadpchaudhari/785bf35d2e59537011545578b38d2a25 to your computer and use it in GitHub Desktop.

Select an option

Save ninadpchaudhari/785bf35d2e59537011545578b38d2a25 to your computer and use it in GitHub Desktop.
Whatsapp chat export - formatting to csv

Moving all of them in the same line

  1. In the find tab: click the .* button.
  2. In Find, paste:
\r?\n(?![\u200E\u200F]?\[\d{1,2}\/\d{1,2}\/\d{2,4},)
  1. Replace with a single space.
  2. Replace the weird [U+200E] with space tooo

Getting the CSV After

  1. In the find tab: click the .* button.
  2. In Find, paste:
^\[([^\]]+)\]\s([^:]+):\s?(.*)$
  1. In Replace, paste:
"$1","$2","$3"
  1. Run Replace All.

That gives you:

  • column 1 = date + time string
  • column 2 = name
  • column 3 = message

If you want a header first, go to the first line and type:

"date_time","name","message"

Post Steps

note: Excel will not show chars from other languages well! The file we just created does not contain metadata to guide it for using UTF-8...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment