0

I have a text file that looks like

Y07976.1/124-271
Y07978.1/48-201

and I want to remove everything after the forward slash such that in the end the text file will look like

Y07976.1
Y07978.1

I am currently learning perl and I think regular expressions are going to be a trouble for awhile but I thought about using

$line=~ s/\W.*//;

but that removes everything after the "." and I want to keep the ".1". I appreciate any help.

Thanks

Edited by spinachio: n/a

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by spinachio
0
s/\/.*$//

thank you -- thank you.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.