CSE12 Lab 4: Simple CSV File Analysis

This file shows the stock returns from an investment portfolio over a year. The “A” column contains the stock name and the “B” column indicates the returns in USD (You can assume that there are no negative stock returns in any of our CSV data files ).
iuww520iuww520iuww520iuww520iuww520iuww520iuww520iuww520
You will run the file lab4_testbench_rv32_rev#.asm file in RARS which takes data.csv as its input CSV file. Doing so will yield the following analysis, based on the calculations made by the assembly files that you will be submitting):
1. Find the total file size in bytes (excluding any metadata generated by your OS) (length_of_file.asm)
2. List the dollar amount of all the input records. (input_from_record.asm)
3. Provide the name of the stock that gives the maximum income. (maxIncome.asm)
4. Provide the name of the stock that gives the minimum income. (minIncome.asm)
5. Calculate the total income generated from all stocks
When you run via RARS lab4_testbench_rv32_rev#.asm with the .asm files shown above completed by you , you will get the output console as shown below:
About the Windows CSV file format
To distinguish between each entry/row/record in the spreadsheet format of the CSV file, the following convention is adopted depending on the OS :
Windows - Lines end with a <CR> and a <LF> character
Linux - Lines end with only a <LF> character
Macintosh (Mac OSX) - Lines end with only a <LF> character
Macintosh (old) - Lines end with only a <CR> character
where <CR> is the carriage return (‘\r’) character and <LF> is the line feed/newline (‘\n’) character.
If you open the provided data.csv file in Notepad++ on Windows with “Show all Characters” enabled, then you should see the following text showing the placement of the carriage return and line feed characters. .
So, for example, if I were to express record 2 from data.csv as a string of characters in RARS, I would write:
“Kramerica,0\r\n”. If you are using an OS that is NOT Windows, it is likely that data.csv would not open correctly due  to the encoding differences. If you have a text editor like Notepad++ that allows you to see all characters, make sure that the “\r\n” appears for each record in the file as shown in Figure 3. This is the case for the data.csv that we include in the directory.
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值