I am attempting to cut the first part of a filename out of a variable.
Filename - servername20090201.csv
servername - all characters until 200
what I am attempting to do is this
---------------
i=servername20090201.csv
echo $i | cut -f1 -d"200"
---------------
Obviously this isn't working for me, can someone assist. The servername is not always a constant size so cut -c1-10 is not going to cut it.
Thanks
Filename - servername20090201.csv
servername - all characters until 200
what I am attempting to do is this
---------------
i=servername20090201.csv
echo $i | cut -f1 -d"200"
---------------
Obviously this isn't working for me, can someone assist. The servername is not always a constant size so cut -c1-10 is not going to cut it.
Thanks