OpenCDSS / cdss-lib-common-java

Colorado's Decision Support Systems (CDSS) common library (Java)
GNU General Public License v3.0
0 stars 1 forks source link

Writing multiple irregular interval time series omits delimiter #18

Open smalers opened 5 years ago

smalers commented 5 years ago

It appears that writing more than one irregular time series to DateValue format omits the delimiter.

smalers commented 5 years ago

A code fix was implemented as shown below. However, now is a bad time to fully resolve this, so the code is attached and can be revisited later.

$ git diff src/RTi/TS/DateValueTS.java
diff --git a/src/RTi/TS/DateValueTS.java b/src/RTi/TS/DateValueTS.java
index 627fed0..dfc09a0 100644
--- a/src/RTi/TS/DateValueTS.java
+++ b/src/RTi/TS/DateValueTS.java
@@ -2569,12 +2569,7 @@ throws Exception
                                // Format the data value
                                string_value = StringUtil.formatString( (value*mult[its] + add[its]),outputFormat );
                            }
-                           if ( its == 0 ) {
-                               buffer.append ( string_value );
-                           }
-                           else {
-                               buffer.append ( delim + string_value );
-                           }
+                           buffer.append ( delim + string_value );^M
                            // Now print the data flag...
                            if ( ts.hasDataFlags() ) {
                                dataflag = tsdata[its].getDataFlag();

Attached file here. DateValueTS.java.txt