Skip to main content
edited tags
Link
Kusalananda
  • 356.1k
  • 42
  • 737
  • 1.1k
added 16 characters in body
Source Link
Ed Morton
  • 35.9k
  • 6
  • 25
  • 60

I am trying to prepend text to the begging/header of a set of .vtt text files with sed in a loop. I'm not replacing any text, only adding text.

I need some line breaks in the text.

The text should read:

WEBVTT Kind: captions Language: eng File Creation Date: 2023-08

WEBVTT Kind: captions Language: eng File Creation Date: 2023-08 

Here is what I am trying:

for file in *.vtt ; do sed -i '' 'WEBVTT/nKind: captions/nLanguage: eng/nFile Creation Date: 2023-08' "$file" done 

give me the error: sed: 1: 'WEBVTT/nKind: captions/ ...': invalid command code W

I'm not sure why. I tried switching double/single quotes, but that didn't work.

I am trying to prepend text to the begging/header of a set of .vtt text files with sed in a loop. I'm not replacing any text, only adding text.

I need some line breaks in the text.

The text should read:

WEBVTT Kind: captions Language: eng File Creation Date: 2023-08

Here is what I am trying:

for file in *.vtt ; do sed -i '' 'WEBVTT/nKind: captions/nLanguage: eng/nFile Creation Date: 2023-08' "$file" done 

give me the error: sed: 1: 'WEBVTT/nKind: captions/ ...': invalid command code W

I'm not sure why. I tried switching double/single quotes, but that didn't work.

I am trying to prepend text to the begging/header of a set of .vtt text files with sed in a loop. I'm not replacing any text, only adding text.

I need some line breaks in the text.

The text should read:

WEBVTT Kind: captions Language: eng File Creation Date: 2023-08 

Here is what I am trying:

for file in *.vtt ; do sed -i '' 'WEBVTT/nKind: captions/nLanguage: eng/nFile Creation Date: 2023-08' "$file" done 

give me the error: sed: 1: 'WEBVTT/nKind: captions/ ...': invalid command code W

I'm not sure why. I tried switching double/single quotes, but that didn't work.

added 132 characters in body
Source Link
Bleakley
  • 183
  • 1
  • 5

I am trying to prepend text to the begging/header of a set upof .vtt text files with sed in a loop. I'm not replacing any text, only adding text. 

I need some line breaks in the text.

The text should read:

WEBVTT Kind: captions Language: eng File Creation Date: 2023-08

Here is what I am trying:

for file in *.vtt ; do sed -i '' 'WEBVTT/nKind: captions/nLanguage: eng/nFile Creation Date: 2023-08' "$file" done 

give me the error: sed: 1: 'WEBVTT/nKind: captions/ ...': invalid command code W

I'm not sure why. I tried switching double/single quotes, but that didn't work.

I am trying to prepend text to a set up files with sed in a loop. I need some line breaks in the text.

Here is what I am trying:

for file in *.vtt ; do sed -i '' 'WEBVTT/nKind: captions/nLanguage: eng/nFile Creation Date: 2023-08' "$file" done 

give me the error: sed: 1: 'WEBVTT/nKind: captions/ ...': invalid command code W

I'm not sure why. I tried switching double/single quotes, but that didn't work.

I am trying to prepend text to the begging/header of a set of .vtt text files with sed in a loop. I'm not replacing any text, only adding text. 

I need some line breaks in the text.

The text should read:

WEBVTT Kind: captions Language: eng File Creation Date: 2023-08

Here is what I am trying:

for file in *.vtt ; do sed -i '' 'WEBVTT/nKind: captions/nLanguage: eng/nFile Creation Date: 2023-08' "$file" done 

give me the error: sed: 1: 'WEBVTT/nKind: captions/ ...': invalid command code W

I'm not sure why. I tried switching double/single quotes, but that didn't work.

Source Link
Bleakley
  • 183
  • 1
  • 5
Loading