---
title: "How can I modify or shorten file names in the data file?"
description: "Use --replace REGEX=STRING to rename or shorten file names in the data file."
canonical: "https://www.codeandweb.com/texturepacker/knowledgebase/how-to-modify-sprite-names"
product: "texturepacker"
source: "html"
---

# How can I modify or shorten file names in the data file?

Use the `--replace REGEX=STRING` option on the command line to rename or shorten file names. Be sure to escape special characters when using a shell:

```bash
TexturePacker sheet.tps --replace button=panel --replace .\*/=
```

This example renames `button.png` to `panel.png`, and removes all folder paths from the sprite names!

To save these replacements in a .tps project, either use `--save` to [update](https://www.codeandweb.com/texturepacker/documentation/commandline.md#updating-tps-files) the project file from the command line, or edit it [manually](https://www.codeandweb.com/texturepacker/documentation/hidden-features.md#replacing-file-names-and-removing-full-path).

## Structured data

```json
{
  "@context": "https://schema.org",
  "@type": "TechArticle",
  "headline": "How can I modify or shorten file names in the data file?"
}
```
