Removing leading characters & spaces

stuartgb100

Active Member
Joined
May 10, 2015
Messages
322
Office Version
  1. 2021
Platform
  1. Windows
Hi,
It's been a while, but hoping you good people can help me again, please ....
I have a lot of data in col B which I've imported from a Word doc.
Problem data looks like this:
| 01
or something similar, but "|" is the problem.
When found, how can I remove it together with any following spaces ?
Many thanks.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Can you please post a sample of your data, so we can see the fill extent of this, and what you data looks like exactly?
 
Upvote 0
Sorry.
Here's a sample:

Folder PATH listing for volume WAV - Target
Volume serial number is C632-D277
F:.
| output.doc
|
+---'70s Rock
| 01_Hotel California (2013 Remaster).flac
| 02_BLACK SABBATH - #Paranoid# (Official Video).flac
| 03_Queen - Bohemian Rhapsody (Official Video Remastered).flac
| 04_Dire Straits - Sultans Of Swing (Official Music Video).flac
| 05_Led Zeppelin - Stairway To Heaven (Official Audio).flac
| 06_Zoo - 'Layla' Top Of The Pops Derek & The Dominos.flac

Regards and thanks.
 
Upvote 0
So, something like:

Excel Formula:
=TRIM(SUBSTITUTE(A1,"|",""))
 
Upvote 0
If it is always at the beginning, and always the same number of spaces, you could do a simple Find/Replace, replacing "| " with nothing, and then it would do them all at once, in place.
 
Upvote 0
If it is always at the beginning, and always the same number of spaces, you could do a simple Find/Replace, replacing "| " with nothing, and then it would do them all at once, in place.
Thanks both.
The formula works fine !
I understand the Find & Replace comment, but not run it yet.
Thanks again.
cheers.
 
Upvote 0

Forum statistics

Threads
1,221,558
Messages
6,160,486
Members
451,651
Latest member
Penapensil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top