开发者

removing special character

How do I remove the greater than < sign from the beginning of the line ^

file.txt
> INSERT INTO
> INSERT INTO

Expected:
INSE开发者_运维百科RT INTO
INSERT INTO


Give this a try:

sed 's/^> //' inputfile


awk

awk '{gsub(/^[ \t]*>[ \t]*/,"")}1' file
awk '{$1=""}1' file

sed

sed 's/^[ \t]*>[ \t]*//' file

cut

cut -d" " -f2- file

or using the shell

while read -r line; do  echo ${line##>}; done < file


awk -F'>' '{print $2}' file.txt
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜