# Attempting to remove first four characters

**URL:** https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009
**Category:** Help & Support
**Created:** [February 8, 2013, 9:56pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009 "2013-02-08T21:56:03Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![dwilbank](https://resource.dopus.com/letter_avatar_proxy/v4/letter/d/898d66/32.png) [@dwilbank](https://resource.dopus.com/u/dwilbank)
#### Post date: [February 8, 2013, 9:56pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/1 "2013-02-08T21:56:03Z")

</div>

`Rename PATTERN=(....)(.+) TO=\2 FINDREP
@NODESELECT`

I heard this was the regex way to do it, but I'm missing something.

Help?

---

<div class="post-metadata">

### Author: ![blueroly](https://resource.dopus.com/user_avatar/resource.dopus.com/blueroly/32/24279_2.png) [@blueroly](https://resource.dopus.com/u/blueroly)
#### Post date: [February 8, 2013, 10:23pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/2 "2013-02-08T22:23:25Z")

</div>

My button has this code...

```auto
Rename REGEXP PATTERN="....(.+)" TO="\1"
```

---

<div class="post-metadata">

### Author: ![anon94230625](https://resource.dopus.com/letter_avatar_proxy/v4/letter/a/e56c9b/32.png) [@anon94230625](https://resource.dopus.com/u/anon94230625)
#### Post date: [February 8, 2013, 10:43pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/3 "2013-02-08T22:43:27Z")

</div>

This one (from buttons section) removes x chars from left, second code from right:

```auto
Rename TYPE=files REGEXP PATTERN ".(.+)(\..*)#{dlgstring|How many chars to remove from left:}" TO "\1\2" AUTORENAME
```

```auto
Rename TYPE=files REGEXP PATTERN "(.+).(.*)(\..*)#{dlgstring|How many chars to remove from right:}" TO "\1\3" AUTORENAME
```

---

<div class="post-metadata">

### Author: ![MrC](https://resource.dopus.com/letter_avatar_proxy/v4/letter/m/43a26b/32.png) [@MrC](https://resource.dopus.com/u/MrC)
#### Post date: [February 8, 2013, 10:53pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/4 "2013-02-08T22:53:34Z")

</div>

You really want the dynamic renamer script! 🙂 (shameless plug fun).

It makes it easy to test out substitutions and pattern matches. Here I told it to replace the first 4 characters with nothing:

![](https://resource.dopus.com/uploads/default/original/3X/0/9/09aca9dfda1b15213d54d1a5af24b3820e9e1058.png)

---

<div class="post-metadata">

### Author: ![dwilbank](https://resource.dopus.com/letter_avatar_proxy/v4/letter/d/898d66/32.png) [@dwilbank](https://resource.dopus.com/u/dwilbank)
#### Post date: [February 9, 2013, 4:30am UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/5 "2013-02-09T04:30:09Z")

</div>

Thank you sirs. Got it working!

For future visitors, Dynamic Script is at

> [@Dynamic Renamer](https://resource.dopus.com/t/dynamic-renamer/14993/2):
>
> I'll update this post with the change list. version 1.12 New: The E flag to the -c case transformation supports elision. New: The f flag to -dd date-guessing allows dates in future. New: The -r replacement transformation supports global, case-ign…

---

<div class="post-metadata">

### Author: ![LeonardB](https://resource.dopus.com/user_avatar/resource.dopus.com/leonardb/32/26176_2.png) [@LeonardB](https://resource.dopus.com/u/LeonardB)
#### Post date: [February 9, 2013, 3:56pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/6 "2013-02-09T15:56:10Z")

</div>

Well, my ignorance is showing again. I installed ActivePerl 64 bit and imported the latest version of Dynamic Renamer.orp but it does not work for me (see below). In fact, my screen does not look like @MrC since the script appears in mine and not his. Can someone/MrC educate me on what I'm doing wrong. I tried it with both a file and a folder and nothing happens. The reason why I was intrigued is because of the functionality like removing contents within brackets.

I apologize if this is not the correct thread to post to.

thank you,

 ![](https://resource.dopus.com/uploads/default/original/3X/9/3/93d4c2d4c10d03abe6f081881e45076995d19472.jpg)

---

<div class="post-metadata">

### Author: ![MrC](https://resource.dopus.com/letter_avatar_proxy/v4/letter/m/43a26b/32.png) [@MrC](https://resource.dopus.com/u/MrC)
#### Post date: [February 9, 2013, 5:23pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/7 "2013-02-09T17:23:22Z")

</div>

The first character of all transformations is a dash, not dot:

```auto
-/....//
```

---

<div class="post-metadata">

### Author: ![LeonardB](https://resource.dopus.com/user_avatar/resource.dopus.com/leonardb/32/26176_2.png) [@LeonardB](https://resource.dopus.com/u/LeonardB)
#### Post date: [February 9, 2013, 6:02pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/8 "2013-02-09T18:02:47Z")

</div>

Thank you. It worked.

---

<div class="post-metadata">

### Author: ![LeonardB](https://resource.dopus.com/user_avatar/resource.dopus.com/leonardb/32/26176_2.png) [@LeonardB](https://resource.dopus.com/u/LeonardB)
#### Post date: [February 9, 2013, 6:06pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/9 "2013-02-09T18:06:00Z")

</div>

Just wondering @MrC, why do I see the Perl script and yours doesn't?

---

<div class="post-metadata">

### Author: ![MrC](https://resource.dopus.com/letter_avatar_proxy/v4/letter/m/43a26b/32.png) [@MrC](https://resource.dopus.com/u/MrC)
#### Post date: [February 9, 2013, 6:08pm UTC](https://resource.dopus.com/t/attempting-to-remove-first-four-characters/15009/10 "2013-02-09T18:08:30Z")

</div>

For the screenshot, I dragged the script portion of the window to be minimal size.
