I'm trying to parse a text file that has a bunch of numbers all on new lines, example:
66124
66125
66587
65874
I'm pulling in those numbers line by line and using them to pull data from another text file that has detailed information I need to capture. My bash script pulls the information between the truck number and a constant then puts that information in a text file called truck$line.txt, but it keeps adding the newline to the filename, example:
truck66124.txt (how I want it)
truck66124
.txt (how I get it currently)
Here's the awk command I'm using:
while read line
do
awk "/$line/,/TIME/" ImportData.text > truck$line.txt
done <trucks.txt
How can I remove the newline characters?
Thanks a bunch
66124
66125
66587
65874
I'm pulling in those numbers line by line and using them to pull data from another text file that has detailed information I need to capture. My bash script pulls the information between the truck number and a constant then puts that information in a text file called truck$line.txt, but it keeps adding the newline to the filename, example:
truck66124.txt (how I want it)
truck66124
.txt (how I get it currently)
Here's the awk command I'm using:
while read line
do
awk "/$line/,/TIME/" ImportData.text > truck$line.txt
done <trucks.txt
How can I remove the newline characters?
Thanks a bunch