# Problem in using greenspline module

**URL:** <https://forum.generic-mapping-tools.org/t/problem-in-using-greenspline-module/1705>\
**Category:** Q&A\
**Created:** [May 22, 2021, 2:55am UTC](https://forum.generic-mapping-tools.org/t/problem-in-using-greenspline-module/1705 "2021-05-22T02:55:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ricky\_Gervais](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/ricky_gervais/32/1287_2.png) [@Ricky\_Gervais](https://forum.generic-mapping-tools.org/u/Ricky_Gervais)\
**Post date:** [May 22, 2021, 2:55am UTC](https://forum.generic-mapping-tools.org/t/problem-in-using-greenspline-module/1705/1 "2021-05-22T02:55:41Z")

</div>

I am having a simple problem with greenspline, if anyone would clarify it I would be grateful.

This is the example given in cookbook :  
gmt begin 1D  
gmt math -T0/10/1 0 1 NRAND = 1D.txt  
gmt plot -R0/10/-5/5 -JX6i/3i -B -Sc0.1 -Gblack 1D.txt  
gmt greenspline 1D.txt -R0/10 -I0.1 -Sc | gmt plot -Wthin  
gmt end show

works just fine, BUT… if I use -N option and give a file instead it shows errors. Why it is?  
Same code with -N option:  
gmt begin 1D1  
gmt math -T0/10/1 0 1 NRAND = 1D.txt  
gmt plot -R0/10/-5/5 -JX6i/3i -B -Sc0.1 -Gblack 1D.txt  
gmt greenspline 1D.txt -N1D\_Nfile.txt -Sc | gmt plot -Wthin  
gmt end show

where 1D\_Nfile.txt contains one column, which is arbitrary values within the -T interval eg.  
1.3  
1.8  
3.4  
4.5  
6.7  
9.8  
in 1D\_Nfile.txt

The error which shows up is shown below:  
greenspline [ERROR]: Mismatch between actual (1) and expected (2) fields near line 1 in file 1D.txt  
greenspline [ERROR]: Mismatch between actual (1) and expected (2) fields near line 2 in file 1D\_Nfile.txt  
greenspline [ERROR]: Input file 1D\_Nfile.txt has 0 column(s) but at least 1 are needed

And program ends.

What is wrong in what I am doing?? Please anyone who knows about it please reply…

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [May 22, 2021, 3:29am UTC](https://forum.generic-mapping-tools.org/t/problem-in-using-greenspline-module/1705/3 "2021-05-22T03:29:20Z")

</div>

IT is a bug that I fixed in the master repo last week or so. 6.2.0 is coming out soon and will have the fix.

---

<div class="post-metadata">

**Author:** ![Ricky\_Gervais](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/ricky_gervais/32/1287_2.png) [@Ricky\_Gervais](https://forum.generic-mapping-tools.org/u/Ricky_Gervais)\
**Post date:** [May 22, 2021, 3:34am UTC](https://forum.generic-mapping-tools.org/t/problem-in-using-greenspline-module/1705/4 "2021-05-22T03:34:41Z")

</div>

**Very Grateful**. 🙂
