Skip to content

Commit db4fe91

Browse files
New Files
1 parent 9b7a528 commit db4fe91

23 files changed

Lines changed: 2591 additions & 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
15.3 KB
Binary file not shown.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 16
4+
VisualStudioVersion = 16.0.29926.136
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSVReader", "CSVReader\CSVReader.csproj", "{00CEA1ED-688C-4830-847E-FE86D76578C6}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{00CEA1ED-688C-4830-847E-FE86D76578C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{00CEA1ED-688C-4830-847E-FE86D76578C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{00CEA1ED-688C-4830-847E-FE86D76578C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{00CEA1ED-688C-4830-847E-FE86D76578C6}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {25AE15F4-4EB8-4899-B258-23EA2F1A77BC}
24+
EndGlobalSection
25+
EndGlobal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration>
3+
<startup>
4+
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
5+
</startup>
6+
</configuration>
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{00CEA1ED-688C-4830-847E-FE86D76578C6}</ProjectGuid>
8+
<OutputType>Exe</OutputType>
9+
<RootNamespace>CSVReader</RootNamespace>
10+
<AssemblyName>CSVReader</AssemblyName>
11+
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
12+
<FileAlignment>512</FileAlignment>
13+
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
14+
<Deterministic>true</Deterministic>
15+
</PropertyGroup>
16+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
17+
<PlatformTarget>AnyCPU</PlatformTarget>
18+
<DebugSymbols>true</DebugSymbols>
19+
<DebugType>full</DebugType>
20+
<Optimize>false</Optimize>
21+
<OutputPath>bin\Debug\</OutputPath>
22+
<DefineConstants>DEBUG;TRACE</DefineConstants>
23+
<ErrorReport>prompt</ErrorReport>
24+
<WarningLevel>4</WarningLevel>
25+
</PropertyGroup>
26+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
27+
<PlatformTarget>AnyCPU</PlatformTarget>
28+
<DebugType>pdbonly</DebugType>
29+
<Optimize>true</Optimize>
30+
<OutputPath>bin\Release\</OutputPath>
31+
<DefineConstants>TRACE</DefineConstants>
32+
<ErrorReport>prompt</ErrorReport>
33+
<WarningLevel>4</WarningLevel>
34+
</PropertyGroup>
35+
<ItemGroup>
36+
<Reference Include="System" />
37+
<Reference Include="System.Core" />
38+
<Reference Include="System.Xml.Linq" />
39+
<Reference Include="System.Data.DataSetExtensions" />
40+
<Reference Include="Microsoft.CSharp" />
41+
<Reference Include="System.Data" />
42+
<Reference Include="System.Net.Http" />
43+
<Reference Include="System.Xml" />
44+
</ItemGroup>
45+
<ItemGroup>
46+
<Compile Include="Program.cs" />
47+
<Compile Include="Properties\AssemblyInfo.cs" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<None Include="App.config" />
51+
</ItemGroup>
52+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
53+
</Project>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace CSVReader
8+
{
9+
class Program
10+
{
11+
static void Main(string[] args)
12+
{
13+
// Read the contents of the CSV file (as plain text)
14+
//string rawCSV = System.IO.File.ReadAllText(@"C:\Users\JLX\Desktop\csv\grades.csv");
15+
16+
// Read the contents of the CSV files as individual lines
17+
string[] csvLines = System.IO.File.ReadAllLines(@"C:\Users\JLX\Desktop\csv\grades.csv");
18+
19+
// Create lists with the CSV data
20+
var firstNames = new List<string>();
21+
var lastNames = new List<string>();
22+
var finalGrades = new List<double>();
23+
24+
// Split each row into column data
25+
for (int i = 1; i < csvLines.Length; i++)
26+
{
27+
string[] rowData = csvLines[i].Split(',');
28+
29+
lastNames.Add(rowData[0]);
30+
firstNames.Add(rowData[1]);
31+
32+
double g = Convert.ToDouble(rowData[7]);
33+
finalGrades.Add(g);
34+
}
35+
36+
Console.WriteLine("FIRST NAMES:");
37+
for (int i = 0; i < firstNames.Count; i++)
38+
{
39+
Console.WriteLine(firstNames[i]);
40+
}
41+
42+
Console.WriteLine("LAST NAMES:");
43+
for (int i = 0; i < lastNames.Count; i++)
44+
{
45+
Console.WriteLine(lastNames[i]);
46+
}
47+
48+
Console.WriteLine("FINAL GRADES:");
49+
for (int i = 0; i < finalGrades.Count; i++)
50+
{
51+
Console.WriteLine(finalGrades[i]);
52+
}
53+
54+
Console.ReadKey();
55+
}
56+
}
57+
}

0 commit comments

Comments
 (0)