# Editing I/O API file dates only

**URL:** <https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811>\
**Category:** I/O API\
**Created:** [July 12, 2019, 3:11pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811 "2019-07-12T15:11:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![skunwar](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@skunwar](https://forum.cmascenter.org/u/skunwar)\
**Post date:** [July 12, 2019, 3:11pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/1 "2019-07-12T15:11:01Z")

</div>

I just want to edit the MCIPv4.5 output files in I/O API format such that year 2000 becomes 2005 and everything else stays the same. What are some ways to tackle this problem?

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [July 12, 2019, 3:17pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/2 "2019-07-12T15:17:04Z")

</div>

Trying to edit in place will mess up the internal data structures. Instead, use M3Tools program _m3tshift_: see [https://www.cmascenter.org/ioapi/documentation/all\_versions/html/M3TSHIFT.html](https://www.cmascenter.org/ioapi/documentation/all_versions/html/M3TSHIFT.html)

---

<div class="post-metadata">

**Author:** ![skunwar](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@skunwar](https://forum.cmascenter.org/u/skunwar)\
**Post date:** [July 12, 2019, 3:47pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/3 "2019-07-12T15:47:47Z")

</div>

m3tshift of I/O API v3.1 didn’t work for me - it kept creating a new file with the same old date (basically not replacing 2000 with 2005)!

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [July 12, 2019, 4:30pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/4 "2019-07-12T16:30:47Z")

</div>

I just re-checked and it works for me. What version do you have (do _ident `which m3tshift`_)?  
The current version has

```
 $Id: m3tshift.f90 117 2019-06-15 14:56:29Z coats $
```

---

<div class="post-metadata">

**Author:** ![skunwar](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@skunwar](https://forum.cmascenter.org/u/skunwar)\
**Post date:** [July 12, 2019, 4:51pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/5 "2019-07-12T16:51:36Z")

</div>

When I typed the command ‘ident m3tshift’, I got:

```
 $Id:: m3tshift.f 79 2014-12-12 16:28:01Z coats $
 $Id:: init3.F 321 2016-02-26 16:00:20Z coats $
```

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [July 12, 2019, 5:51pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/6 "2019-07-12T17:51:48Z")

</div>

This version is at least 4 versions (jun152019, dec12017, sep092017, jun142016) out-of-date. You may want to update… everything.

---

<div class="post-metadata">

**Author:** ![skunwar](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@skunwar](https://forum.cmascenter.org/u/skunwar)\
**Post date:** [July 12, 2019, 6:27pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/7 "2019-07-12T18:27:13Z")

</div>

Looks like only v3.2 is on github, I will download the tar-zip of v3.1 directly at [https://www.cmascenter.org/ioapi/download/ioapi-3.1.tar.gz](https://www.cmascenter.org/ioapi/download/ioapi-3.1.tar.gz)

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [July 12, 2019, 7:30pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/8 "2019-07-12T19:30:55Z")

</div>

Both of these versions should work correctly, unless you’re doing something like

`setenv PROMPTFLAG N`

I’d need to see a complete log to help any further.

---

<div class="post-metadata">

**Author:** ![skunwar](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@skunwar](https://forum.cmascenter.org/u/skunwar)\
**Post date:** [April 30, 2020, 6:54pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/9 "2020-04-30T18:54:57Z")

</div>

In a command line interactive execution of the I/O API tool **m3tshift** , I just press the ‘enter’ key to accept default value, but in a shell script version of the same tool in UNIX, what should I write in the code that indicates ‘enter’ key equivalent to accept the default values? A blank is not working for me.

---

<div class="post-metadata">

**Author:** ![cjcoats](https://avatars.discourse-cdn.com/v4/letter/c/ac8455/32.png) [@cjcoats](https://forum.cmascenter.org/u/cjcoats)\
**Post date:** [April 30, 2020, 7:26pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/10 "2020-04-30T19:26:06Z")

</div>

I normally do something like the following (in this example, from a script for _m3probe_, which has a somewhat-complicated set of prompts and defaults) [where I’m having to use backslash-poundsymbol to make this editor happy;-(]

```
set UI = /tmp/m3probe.$$

echo "Yes " >& ${UI} \# continue with the program
echo " " >> ${UI} \# default starting date
echo " " >> ${UI} \# default starting time
echo " " >> ${UI} \# default ending date
echo " " >> ${UI} \# default ending time
echo " " >> ${UI} \ # default time step
echo "${VARIABLE} " >> ${UI} \ # name for variable to be probed
echo "${POINT} " >> ${UI} \ # number for stream-reach to be probed
echo "0 " >> ${UI} \# end list of points

time ${pgm} < ${UI}
set foo = ${status}
if ( ${foo} != 0 ) echo "ERROR ${foo} on program m3probe"
exit ( ${foo} )
```

---

<div class="post-metadata">

**Author:** ![skunwar](https://avatars.discourse-cdn.com/v4/letter/s/9f8e36/32.png) [@skunwar](https://forum.cmascenter.org/u/skunwar)\
**Post date:** [May 4, 2020, 3:16pm UTC](https://forum.cmascenter.org/t/editing-i-o-api-file-dates-only/811/11 "2020-05-04T15:16:08Z")

</div>

Thanks - I use a tcsh shell, and some changes worked for me:

```
mkdir -p temp_files
set UI = $cwd/temp_files/temp_response_m3tshift_2may2020.${source_YYYYMMDD}.${SECTOR}.$$
echo INFILE >> ${UI} \ 
echo "" >> ${UI} \ 
echo "" >> ${UI} \ 
echo ${YYYYDDD_target} >> ${UI} \ 
echo "" >> ${UI} \ 
echo "" >> ${UI} \ 
echo "" >> ${UI} \ 
echo OUTFILE >> ${UI}
# ###################################################################
/proj/MYLIB/ioapi/Linux2_x86_64ifort/m3tshift < $UI
```
