Quantcast
Channel: Active questions tagged bash+awk - Ask Ubuntu
Viewing all articles
Browse latest Browse all 102

extract the oldest values from a master file per each code

$
0
0

I need help writing a script that would extract from a master file the oldest records and save them in a separate file. The file contains hundreds of ISIN codes and additional data. For each, there are daily records. The perfect script would take out the whole oldest row and save it in a separate file named by that ISIN code. So I am guessing split and grep combinations?

Example:

Column A - ISIN code (i.e. XX1234567891) <- 2 letters and 10 numbers

Column C - Date - 08/04/2019

Column B & D-I - relevant data.

Any suggestions ? Please keep in mind that I am really at the beginning of my journey with bash.

Thank you in advance for any help

Below is the link to the example file: https://drive.google.com/file/d/1Q3qhrVlIMA7cJhDVxjxoHCipEl8sV-xo/view?usp=sharing

example with 3 different ISIN's: example with 3 different ISIN's

One file with the oldest record: One file with the oldest record

Second file with the oldest record: Second file with the oldest record

3rd one with the oldest records - both with same date: 3rd one with the oldest records - both with same date

Dates are in DD/MM/YYYY format (now that I look at it in Libre I can see that the date format changed to MM/DD/YYYY - but that I can adjust later).


Viewing all articles
Browse latest Browse all 102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>