Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribedHello 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

image text in transcribed

image text in transcribed

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, Greece

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2010 Barcelona Spain September 2010 Proceedings Part 1 Lnai 6321

Authors: Jose L. Balcazar ,Francesco Bonchi ,Aristides Gionis ,Michele Sebag

2010th Edition

364215879X, 978-3642158797

Students also viewed these Databases questions

Question

explain the concept of strategy formulation

Answered: 1 week ago