How do I remove the last 4 characters within a cell

  • Thread starter Thread starter Problem poser
  • Start date Start date
P

Problem poser

I have copied hundreds of .jpg file names, using DOS, to copy them into a
listing within a worksheet. As a substantial amount are numeric with a file
extension I would like to split the cells to remove file extension to give me
a numeric result.

i.e.
"123.jpg" into a numeric "123" or "Many files.jpg" into "Many files"

The file names are variable in size and are either numeric or just characters
Thank you
 
try this

=SUBSTITUTE(A1,".jpg","")

or

Select the column
Go to Data | text column | delimited | next | choose other option :
put an dot | next
select the jpg column in data preview | choose do not import (skip)
option | finish |
 
Since there are different lengths, I would use Ctrl+H
replace: .jpg
with: (leave this blank)
Replace All
 
Thank you Angela, Mike and Muddan
This is the first time that I have used this discussion group
All answers work and "I am impressed"with the time to respond.

Thank you again

Michael
 
Back
Top