I've already extracted the line numbers needed from the input file (i.e 1 through N). I now need to be able to use the input file with this 1-through-N to output to a new file. The pattern matching has already occurred in a previous function which extracted the line numbers from the input file. Now I need to take this range of numbers using the input file and output that range into a new file. I don't need to do any pattern matching, just need to do 1-through-N to a new file.
I'm currently using a bash script with Awk extracting the necessary information to generate the ranged data from the input file. Now I need to take that rage and create a new file (using the input file) from 1 to N.
sed -i '1,'"$N" input.txt > input.log
to go from 1 to N using my input file input.txt and outputting to input.log file but I get the following error:
sed: -e expression #1, char 3: missing command
The line of code above is within a bash script.