Skip to main content
Put code in code block and quoted text in quote block
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718

If you want to delete all lines that start with one space.

You can use grep with -v :

grep -v -E '^ .*$' Contacts.vcf > tt.txt

  grep -v, --invert-match
          Invert the sense ofE matching,'^ to.*$' selectContacts.vcf non-matching> linestt.txt

-v, --invert-match

Invert the sense of matching, to select non-matching lines.

And, "$"$ represents the end of the line.

There should be no characters after it.

Therefore, the asterisk after "$" should be$ is meaningless.

If you want to delete all lines that start with one space.

You can use grep with -v :

grep -v -E '^ .*$' Contacts.vcf > tt.txt

   -v, --invert-match
          Invert the sense of matching, to select non-matching lines.

And, "$" represents the end of the line.

There should be no characters after it.

Therefore, the asterisk after "$" should be meaningless.

If you want to delete all lines that start with one space.

You can use grep with -v :

grep -v -E '^ .*$' Contacts.vcf > tt.txt

-v, --invert-match

Invert the sense of matching, to select non-matching lines.

And, $ represents the end of the line.

There should be no characters after it.

Therefore, the asterisk after $ is meaningless.

Source Link
James
  • 53
  • 6

If you want to delete all lines that start with one space.

You can use grep with -v :

grep -v -E '^ .*$' Contacts.vcf > tt.txt

   -v, --invert-match
          Invert the sense of matching, to select non-matching lines.

And, "$" represents the end of the line.

There should be no characters after it.

Therefore, the asterisk after "$" should be meaningless.