Welcome to WEAP's Website WEAP
WEAP is an initiative of the Stockholm Environment Institute.


About WEAP

Home
Why WEAP?
Features
What's New?
Sample Screens
Demonstration
Publications
History and Credits

Using WEAP
Download
Licensing
User Guide
Tutorial
Videos (YouTube)

User Forum
Discussions
Members List
Edit Profile

Additional Support
Training
University Courses
Collaboration

About Us
SEI-US Water Resources Program
Please Contact Us

LEAP
Interested in Energy?
Read about LEAP: SEI's software for energy planning.

Link WEAP and LEAP for combined Water-Energy planning.
Watch a video demo!
   

User Forum

All Topics | Topic "Read format from csv text file"
Log in to post new messages or reply to existing messages.
 
Author Message
Mrs. Beatriz Cecilia Martinez Contreras

Subject: Read format from csv text file   
Posted: 2/25/2020 Viewed: 2103 times
Good morning everyone:


I have a problem trying to load the data with weekly resolution in csv format, from read from file wizard, leaving the following error:

"There is not column named" precipitation "in file, column names listed in the $ columns directive in this file:" year, week, precipitation "

I appreciate your help.

Beatriz
Ms. Anne Hereford

Subject: Re: Read format from csv text file   
Posted: 3/21/2020 Viewed: 2066 times
Dear Beatriz,
Have you seen this section (below) of the WEAP help that provides an example of how to name your columns in your CSV file?


Column Descriptions
Use the optional $Columns directive to describe the contents and unit for each data column. The optional unit, if included, is in square brackets after the name. This is a very good way to document your data. In addition, you can then refer to columns by their name instead of their number in the ReadFromFile expression -- not only will this make for a clearer expression, but the reference will still be correct if you later add or remove columns in the file. Here is an example from a climate file named Climate.csv with 5 data columns (rainfall, min and max temperature, humidity and wind):

$Columns = Precipitation[mm], Min Temperature[C], Max Temperature[C], Relative Humidity[%], Wind Speed[m/s]

Here's how to refer to the Max Temperature column in the ReadFromFile expression: ReadFromFile(Climate.csv, "Max Temperature[C]") Note: you must enclose the column name in quotes. The unit is optional and can be omitted, e.g., ReadFromFile(Climate.csv, "Max Temperature")

Optionally, you may list the time columns first. Some examples:

Annual: $Columns = Year, Population

Monthly: $Columns = Year, Month, Burlington Brook USGS 1188000[CFS], Weber River USGS 1932000[CFS]

Daily: $Columns = Date, Precipitation[mm], Mean Temperature[C]

If any column names include the list separator character, you must enclose the name in quotes, e.g., "Daily Temperature, Average[C]"

The ReadFromFile and FDCShift Wizards will display information from the $Columns directive.


Topic "Read format from csv text file"