Unable to make progress while taking input from one file and writing into another file using unix cat command

Problem:
First, you should add all the info from the courses.csv file since you need the major_id for inserting the student info. cat is a terminal command for printing the contents of a file. Here’s an example: cat <filename>. Below the comment you added, use it to print courses.csv.

  1. Add cat courses.csv to your insert_data.sh file below your comment

Command/Solution Tried:
~/project$ cat courses.csv >> insert_data.sh

Warning:
Your script should have the suggested command added correctly

Although, I see out file is correctly generated. Not sure what I am missing here, any help here is appreciated. Thanks!

Note:
Tried to reset the file multiple times.

1 Like

I have the same problem :melting_face:

put ‘cat courses.csv’ into the insert_data file, not in the terminal, (the next step is run this file) the data should not show in the inserta_data file, and it will be work.

1 Like

put ‘cat courses.csv’ into the insert_data file, not in the terminal, (the next step is run this file) the data should not show in the inserta_data file, and it will be work.

Thanks, brother! It worked.

Using File Methods:

  • Creating/opening an output file in writing mode.
  • Opening the input file in reading mode.
  • Reading each line from the input file and writing it in the output file.
  • Closing the output file.