| 1 | In order to give you some help you can use those commands and/or scripts: |
| 2 | |
| 3 | In our case: |
| 4 | |
| 5 | 1. File sechiba.f90: |
| 6 | |
| 7 | |
| 8 | How to get info for column '''field id''': |
| 9 | |
| 10 | {{{ |
| 11 | cat src_sechiba/sechiba.f90 | grep xios_orchidee_send_field | cut -d\" -f2 > fields_id.txt |
| 12 | }}} |
| 13 | |
| 14 | 2. At src_xml/file_def_orchidee.xml |
| 15 | |
| 16 | Python script to extract the columns showned below: |
| 17 | |
| 18 | {{{ |
| 19 | # def xml file |
| 20 | with open('field_def_orchidee_sechiba.xml', 'r') as content_file: |
| 21 | data = content_file.readlines() |
| 22 | |
| 23 | # contains all ids to search |
| 24 | with open('fields_id.txt', 'r') as cfile: |
| 25 | fids= cfile.readlines() |
| 26 | |
| 27 | # search for all keys |
| 28 | for idf in fids: |
| 29 | cleanid = idf.replace('\n','') |
| 30 | |
| 31 | # search for all lines from xml |
| 32 | for line in data: |
| 33 | # split lines into array according to " char |
| 34 | splt = line.split('"') |
| 35 | |
| 36 | # ignore empty lines or those with 1 element |
| 37 | if splt is None or len(splt) == 1: |
| 38 | continue |
| 39 | # replace return carry to nothing |
| 40 | lineid = line.split('"')[1].replace('\n','') |
| 41 | |
| 42 | # it is mandatory to get the exact match |
| 43 | if cleanid == lineid: |
| 44 | # print on screen |
| 45 | print line.split('"')[NUMBER_TO_CHANGE] |
| 46 | }}} |
| 47 | |
| 48 | Regarding line: |
| 49 | {{{ |
| 50 | print line.split('"')[NUMBER_TO_CHANGE] |
| 51 | }}} |
| 52 | |
| 53 | '''Replace NUMBER_TO_CHANGE according to those numbers to get the desired colum info''': |
| 54 | * use 3, Output name set in field_def |
| 55 | * use 5, Long name |
| 56 | * use 7, Unit in output |
| 57 | |
| 58 | For field_def_orchidee_sechiba.xml, it was modified deleting all those non sechiba keys in order to minimize errors. Modify according to your needs. |
| 59 | |
| 60 | Once extracted, you can directly paste data into excel page. |