Question
Hello friend. I use Bash-Linux I have an in_file with the structure in the first photo (and it continuous with the same structure for multiple
Hello friend.
I use Bash-Linux
I have an in_file with the structure in the first photo (and it continuous with the same structure for multiple date). Now in an output file I want to the following output (second image) and when the year change (to 2018) I should put dividing line as it seems below
Now, to create the list I did:
echo "YYYY MM DD hh:mm:ss.ss lat_N lon_E Depth(km) Mw Region" >> $outputfile
awk '/^EVENT/ {matrx1[NR+2]} ;NR in matrx1 {printf "%10s %10s %7.4f %7.4f %5s", $1,$2,$5,$6,$9};/^EVENT/{matrx2[NR+6]}; NR in matrx2 {printf "%6.1f",$2}; /^EVENT/ {printf "%10s %6s", $3,$4}' $in_file | sed 's/\// /g' >> $outputfile
But , because The REGION is first at the infile (/^EVENT/ {printf "%10s %6s", $3,$4}), , it prints it first of all of them. I want to print them in the order I wrote it and then how to I print the divided line everytime the year change.
And also, the header part isn't working. I thought:
header1=''Seismological stations'
awk 'NR>FNR&&FNR>=(NR-FNR*2) {printf "%b ", $header1}' > $outputfile
So sorry for the information bombing but I really need help!
Thank you so so much!
DATA_TYPE BULLETIN IMS1.0:LONG AUTH Event Bulletin EVENT 2017 tpye NW Balkan Region 2018033117:50:39.735.08324.73010.3.1 Crete, GreeceStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started