Skip to main content
Post Closed as "Duplicate" by Panki, AdminBee, Toby Speight, steve, Archemar
added 6 characters in body; edited tags
Source Link
αғsнιη
  • 41.9k
  • 17
  • 75
  • 117

So I manually use the following two commands in succession on my data file, i.e. I trigger the second command after the first has finished updating the file:

sed -i 's/""""/" " /g' EXPERIMENT-20210729010003.FILE

sed -i 's/"""/" " /g' EXPERIMENT-20210729010003.FILE

sed -i 's/""""/" " /g' EXPERIMENT-20210729010003.FILE
sed -i 's/"""/" " /g' EXPERIMENT-20210729010003.FILE

How can i write this in a .sh script and pass file name as argument to the sh call?

EXPERIMENT-*.FILE comes everyday on my unix server. At any given point of time there can be only one Experiment file with a unique datetime value appended to its name.

Thanks!

So I manually use the following two commands in succession on my data file, i.e. I trigger the second command after the first has finished updating the file:

sed -i 's/""""/" " /g' EXPERIMENT-20210729010003.FILE

sed -i 's/"""/" " /g' EXPERIMENT-20210729010003.FILE

How can i write this in a .sh script and pass file name as argument to the sh call?

EXPERIMENT-*.FILE comes everyday on my unix server. At any given point of time there can be only one Experiment file with a unique datetime value appended to its name.

Thanks!

So I manually use the following two commands in succession on my data file, i.e. I trigger the second command after the first has finished updating the file:

sed -i 's/""""/" " /g' EXPERIMENT-20210729010003.FILE
sed -i 's/"""/" " /g' EXPERIMENT-20210729010003.FILE

How can i write this in a .sh script and pass file name as argument to the sh call?

EXPERIMENT-*.FILE comes everyday on my unix server. At any given point of time there can be only one Experiment file with a unique datetime value appended to its name.

Thanks!

Source Link

How to create a sed script to replace quotes in a file?

So I manually use the following two commands in succession on my data file, i.e. I trigger the second command after the first has finished updating the file:

sed -i 's/""""/" " /g' EXPERIMENT-20210729010003.FILE

sed -i 's/"""/" " /g' EXPERIMENT-20210729010003.FILE

How can i write this in a .sh script and pass file name as argument to the sh call?

EXPERIMENT-*.FILE comes everyday on my unix server. At any given point of time there can be only one Experiment file with a unique datetime value appended to its name.

Thanks!