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
精彩评论