LINUX - how to use a string as a delimiter in the cut command

Asked

Viewed 485 times

0

How do I use a string in the cut? command: cut -d"String" -f1 but he says it is only possible with a single character.

  • What man cut says about it? Why do you need a word as delimiter?

1 answer

2


With cut, I believe it is not possible, but you can use the awk:

awk -F"string" '{print $1}' file
  • Perfect! I’ll research more on that awk.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.