DEV Community

TokViewer Editorial
TokViewer Editorial

Posted on Fully Autonomous

Test Long Comment IDs Before Joining a CSV in Excel

Disclosure: I write for the tokviewer.app editorial team. This tutorial was prepared with AI assistance. All example identifiers and comments below are invented test fixtures, not records collected from TikTok.

A comment export can look readable while its identifiers are already damaged. That becomes visible when you join replies to parent comments or remove duplicates: two IDs that differ near the end may collapse into the same spreadsheet number.

Microsoft documents Excel's 15-significant-digit numeric precision limit. Identifiers should enter the spreadsheet as text. Widening the column or changing a damaged cell to Text does not restore digits that were lost earlier.

Build a fixture that exposes rounding

Use two invented IDs differing only in their last digit:

comment_id,parent_comment_id,comment
1234567890123456788,,Fictional parent question
1234567890123456789,1234567890123456788,Fictional reply
Enter fullscreen mode Exit fullscreen mode

Both IDs have 19 digits. Their length is a property of this fixture, not a universal rule for every TikTok identifier. The fixture tests whether the import preserves the distinguishing suffix and the parent relationship.

Keep an untouched reference in a plain-text editor. Do not open and resave that reference through Excel before using it for comparison. Quoting digit strings in CSV would not solve the typing problem: CSV quotation marks delimit a field, but they do not declare an Excel column as text.

Assign types before numeric conversion

In desktop Excel with the Text/CSV Power Query importer, open a blank workbook and choose Data > From Text/CSV. Select the fixture and use Transform Data to inspect the conversion steps before loading.

If an automatic Changed Type step turns the identifiers into numbers, remove that step before setting comment_id and parent_comment_id to Text. Assigning Text after numeric conversion can preserve an already rounded value. Keep the comment column as text too.

Load the table at A1 for the checks below, with headers in row 1. If your Excel edition lacks that import path, use a native workbook export that writes identifier cells as strings, when available, and still validate it. A workbook extension by itself does not establish correct cell types.

Compare every character against the source

Enter these checks in spare cells outside the imported table:

=ISTEXT(A2)
=ISTEXT(A3)
=EXACT(A2,"1234567890123456788")
=EXACT(A3,"1234567890123456789")
=EXACT(A2,A3)
=EXACT(B3,A2)
Enter fullscreen mode Exit fullscreen mode

Expected results are TRUE, TRUE, TRUE, TRUE, FALSE, TRUE in that order. They are expectations for the fixture, not an account of an executed Excel session. Some locale settings use semicolons between formula arguments.

Keep the reference IDs quoted in formulas. Otherwise the test literal itself can become a spreadsheet number. Microsoft describes EXACT as a comparison of text strings, so pair it with a cell-type check and an independently preserved source.

The final parent-link check is useful but insufficient alone. It could pass if both the parent ID and its reference were damaged identically. Comparing against the original strings catches that shared error.

Apply the same contract to real exports

Validate comment_id, parent_comment_id and video_id as strings before joins. Keep count fields numeric where arithmetic is appropriate. Preserve missing IDs as missing; a local display label or a guessed suffix is not a platform identifier.

Repeat the checks after saving and reopening the workbook. Saving back to CSV removes workbook type information, so the next import needs the same precautions. For developer pipelines, keep IDs as strings during JSON parsing, storage and serialization as well; a final string conversion cannot repair upstream rounding.

The full comment-ID import guide includes the practice file and product-specific export details. Passing these checks establishes record identity within the file. It still does not prove that the capture includes every comment or reply on its source video.

Top comments (0)