q_as:start
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| q_as:start [2024-09-06 06:10 am] – hcho | q_as:start [2024-09-20 08:23 am] (current) – hcho | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ===== Column appending problem ===== | ===== Column appending problem ===== | ||
| - | [[lab_members: | + | * Author: |
| + | * Data: {{ q_as: | ||
| - | How do you append a new column to an object file which is for a certain coordinate and contains the timeseries of multiple climatic parameters | + | How do you append a new column to an object file from a source file? The object file is for a certain coordinate and contains the timeseries of multiple climatic parameters. The source file '' |
| - | Data: {{ q_as:column_appending_problem.zip |}} | + | ==== Solution ==== |
| + | |||
| + | <file bash doit.sh> | ||
| + | #!/bin/sh | ||
| + | for i in *.mtc43; do | ||
| + | coor=$(echo $i | sed ' | ||
| + | ( | ||
| + | echo -e " | ||
| + | grep $coor vs.txt | cut -d, -f3 | ||
| + | ) > tmp.$$ | ||
| + | paste $i tmp.$$ > tmp2.$$ | ||
| + | mv tmp2.$$ $i | ||
| + | done | ||
| + | |||
| + | rm -f tmp*.$$ | ||
| + | </ | ||
| + | |||
| + | ===== Extract grid cell IDs ===== | ||
| + | |||
| + | In {{ :q_as:veg_param_nm_003125deg.zip |}}, extract grid cell IDs. | ||
| ===== Files ===== | ===== Files ===== | ||
| {{filelisting}}\\ | {{filelisting}}\\ | ||
q_as/start.1725624619.txt.gz · Last modified: by hcho
