Convert vmsg to csv

Convert VMSG to CSV

Extract SMS records from VMSG backups into searchable, spreadsheet-compatible CSV files.

Make CSV files online

We can't read VMSG files yet, so this conversion isn't available. If you can export your work to one of these formats - or others - we'll turn it into CSV:

How to convert vmsg to csv file

An old phone backup or messaging utility may export SMS records as .vmsg, while spreadsheets, databases, and reporting tools usually require .csv. Conversion turns message records into rows that can be searched, filtered, edited, or imported.

What the VMSG format is

VMSG, also called vMessage, is a text-based format used by older mobile phones, phone-suite software, and SMS backup utilities. A file commonly contains BEGIN:VMSG, BEGIN:VENV, and BEGIN:VBODY sections with properties such as TEL, DTSTART, SUBJECT, BODY, X-IRMC-BODY, X-IRMC-TYPE, and X-IRMC-BOX.

VMSG is readable as plain text, but its nested records and vendor-specific properties are not automatically displayed as rows and columns. Some files store the phone number in a surrounding VCARD section rather than inside the message body.

What the CSV format is

CSV represents tabular data as rows and fields. Excel, LibreOffice Calc, Google Sheets, database import tools, and most scripting libraries support it. A message export commonly uses columns such as date, phone, type, folder, subject, and body.

CSV is useful for sorting by date, filtering incoming and outgoing messages, searching message text, importing records into another system, and creating a compact text archive. It does not retain VMSG syntax, attachments, delivery states, or vendor-specific metadata unless those values are explicitly exported to additional columns.

Convert the file with a local script

There is no universal VMSG standard implementation: phone vendors and backup programs use different property names and encodings. A small local Python parser is usually safer than uploading private messages to a generic conversion website.

Install Python 3, save the following as vmsg_to_csv.py, and place it beside the source file:

import csv
import sys
import quopri


def decode(value, params):
    if any(p.upper() == 'ENCODING=QUOTED-PRINTABLE' for p in params):
        value = quopri.decodestring(value).decode('utf-8', errors='replace')
    slash = chr(92)
    return (value.replace(slash + 'n', '\n')
                 .replace(slash + 'N', '\n')
                 .replace(slash + ',', ',')
                 .replace(slash + ';', ';')
                 .replace(slash + slash, slash))


def convert(source, destination):
    rows = []
    record = None
    contact_tel = ''
    in_vcard = False

    with open(source, encoding='utf-8-sig', errors='replace') as handle:
        lines = []
        for raw in handle:
            line = raw.rstrip('\r\n')
            if line.startswith((' ', '\t')) and lines:
                lines[-1] += line[1:]
            else:
                lines.append(line)

    for line in lines:
        upper = line.upper()
        if upper == 'BEGIN:VCARD':
            in_vcard = True
            continue
        if upper == 'END:VCARD':
            in_vcard = False
            continue
        if upper == 'BEGIN:VBODY':
            record = {}
            continue
        if upper == 'END:VBODY':
            if record is not None:
                record['_CONTACT_TEL'] = contact_tel
                rows.append(record)
            record = None
            continue
        if ':' not in line:
            continue
        left, value = line.split(':', 1)
        parts = left.split(';')
        name = parts[0].upper()
        value = decode(value, parts[1:])
        if in_vcard and name == 'TEL':
            contact_tel = value
        elif record is not None:
            record[name] = value

    def first(row, names):
        for name in names:
            if row.get(name, ''):
                return row[name]
        return ''

    columns = ['date', 'phone', 'type', 'folder', 'subject', 'body']
    with open(destination, 'w', newline='', encoding='utf-8-sig') as handle:
        writer = csv.DictWriter(handle, fieldnames=columns)
        writer.writeheader()
        for row in rows:
            writer.writerow({
                'date': first(row, ['DTSTART', 'DATE']),
                'phone': first(row, ['TEL', 'X-IRMC-RECIPIENT', 'TO', 'FROM', '_CONTACT_TEL']),
                'type': first(row, ['X-IRMC-TYPE', 'TYPE']),
                'folder': first(row, ['X-IRMC-BOX', 'FOLDER']),
                'subject': first(row, ['SUBJECT']),
                'body': first(row, ['BODY', 'X-IRMC-BODY', 'TEXT', 'MESSAGE'])
            })


if len(sys.argv) != 3:
    raise SystemExit('Usage: python vmsg_to_csv.py input.vmsg output.csv')
convert(sys.argv[1], sys.argv[2])

Run python vmsg_to_csv.py messages.vmsg messages.csv. On systems that use the python3 command, run python3 vmsg_to_csv.py messages.vmsg messages.csv. Open the result in Calc or Excel; the UTF-8 byte-order mark helps spreadsheet software detect non-ASCII characters.

Before conversion, open a copy of the VMSG file in a text editor and check its actual property names. The script recognizes common aliases, including BODY, X-IRMC-BODY, TEXT, and MESSAGE. If messages use another name, add it to the body list in the script. If the file uses a non-UTF-8 character set, change the input encoding and test accented characters before processing the full backup.

Other conversion options

A dedicated utility such as vmsg2csv may work for a specific phone-backup variant, but verify its source, supported properties, and output with a small copy first. Availability and compatibility of older utilities vary, and many do not decode quoted-printable text, folded lines, or vendor-specific fields correctly.

LibreOffice Calc and Excel can open CSV, but they are not reliable VMSG parsers. Importing a VMSG file through File → Open only works after the records have already been normalized into delimited rows.

Generic online converters rarely list VMSG as a supported input and may misread its nested structure. Use an online service only if it explicitly supports VMSG, explains its retention and deletion policy, uses HTTPS, and does not require unnecessary account access. Do not upload SMS backups containing private messages, phone numbers, or authentication codes unless the privacy risk is acceptable.

Check the converted data

Compare several CSV rows with the source, including messages containing commas, line breaks, quotation marks, non-ASCII characters, and empty bodies. Python's CSV writer quotes commas and embedded line breaks correctly, but a phone program may store multiline or quoted-printable content in a vendor-specific form that needs additional decoding.

Keep the original VMSG file. CSV is a flattened interchange format and may omit attachments, read or delivery status, contact structure, timestamps with timezone information, and fields that were not included in the selected output columns.

Additional formats for
vmsg file conversion

Convert to csv from
other formats

Share on social media: