Skip to main content

I have a filename like a.b.c.txt, I want this string to be splittedsplit as

string1=a.b.c
string2=txt

Basically I want to split filename and its extension.I I used cut but it splits as a,b,c and txt. I want to cut the string on the last delimiter.

Can somebody help  ?

I have a filename like a.b.c.txt, I want this string to be splitted as

string1=a.b.c
string2=txt

Basically I want to split filename and its extension.I used cut but it splits as a,b,c and txt. I want to cut string on last delimiter.

Can somebody help  ?

I have a filename like a.b.c.txt, I want this string to be split as

string1=a.b.c
string2=txt

Basically I want to split filename and its extension. I used cut but it splits as a,b,c and txt. I want to cut the string on the last delimiter.

Can somebody help?

Improved formatting
Source Link
heemayl
  • 58.1k
  • 9
  • 129
  • 144

I have a filename like "a.b.c.txt"a.b.c.txt, I want this string to be splitted as string1="a.b.c" and string2="txt".

string1=a.b.c
string2=txt

Basically I want to split filename and its extension.I used cut but it splits as a,b,ca,b,c and txttxt. I want to cut string on last delimiter.

Can somebody help ?

I have a filename like "a.b.c.txt" I want this string to be splitted as string1="a.b.c" and string2="txt".

Basically I want to split filename and its extension.I used cut but it splits as a,b,c and txt. I want to cut string on last delimiter.

Can somebody help ?

I have a filename like a.b.c.txt, I want this string to be splitted as

string1=a.b.c
string2=txt

Basically I want to split filename and its extension.I used cut but it splits as a,b,c and txt. I want to cut string on last delimiter.

Can somebody help ?

Source Link

cut string on last delimiter

I have a filename like "a.b.c.txt" I want this string to be splitted as string1="a.b.c" and string2="txt".

Basically I want to split filename and its extension.I used cut but it splits as a,b,c and txt. I want to cut string on last delimiter.

Can somebody help ?