• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net

ThE LongesT ThreaD EveR

PHP:
using System;
using System.IO;
using System.Data;
using System.Configuration;

namespace Text_Import
{
	public class TextAnalyzer
	{
		public TextAnalyzer()
		{

		}

		// Get The File Path to the ASCII database
		public string FilePath()
		{
			string filePath;
			filePath = ConfigurationSettings.AppSettings["path"];
			return(filePath);
		}

		// Find the number of rows in the file
		public int RowAmount()
		{
			int rowAmount;
			StreamReader cRows = new StreamReader(@"C:\test.txt");
			string cLine = cRows.ReadLine();
			int charAmount = Int32.Parse(cLine.Length.ToString());
			
			string cAll = cRows.ReadToEnd();
			int allAmount = Int32.Parse(cAll.Length.ToString());

			rowAmount = (allAmount)/(charAmount);
			return(rowAmount);
		}

		// Read Each Row
		int RowNum;
		int Position;
		public string ReadRow()
		{
			string readRow;
			StreamReader rRow = new StreamReader(@"C:\test.txt");
			string OneRow = rRow.ReadLine();
			string AllText = rRow.ReadToEnd();
			int RowLength = Int32.Parse(OneRow.Length.ToString()) + 2;
			int EntireLength = Int32.Parse(AllText.Length.ToString());
			if (Position <= EntireLength - 1830)
			{
				Position = (RowLength * RowNum);
				RowNum++;
			}
			readRow = AllText.Substring(Position, RowLength);
			return(readRow);
		}

		// The data Table!!!
		public DataTable Table()
		{
			TextAnalyzer ta = new TextAnalyzer();

			ta.FilePath();

			DataTable Table = new DataTable("Main Table");
			DataRow row;

			DataColumn ISBN = new DataColumn("ISBN");
			DataColumn IDC = new DataColumn("IDC");
			DataColumn UPC = new DataColumn("UPC");
			DataColumn Title = new DataColumn("Title");
			DataColumn SeriesID = new DataColumn("sID");
			DataColumn ID = new DataColumn("ID");
			ID.AutoIncrement = true;

			Table.Columns.Add(ISBN);
			Table.Columns.Add(IDC);
			Table.Columns.Add(UPC);
			Table.Columns.Add(Title);
			Table.Columns.Add(SeriesID);
			Table.Columns.Add(ID);

			for (int i=1;i<=ta.RowAmount();i++)
			{
				row = Table.NewRow();
				string rowParse = ta.ReadRow();
				row[ISBN] = rowParse.Substring(0, 10);
				row[IDC] = rowParse.Substring(11, 1);
				row[UPC] = rowParse.Substring(442, 17);
				row[Title] = rowParse.Substring(11, 150);
				row[SeriesID] = rowParse.Substring(212, 9);
				Table.Rows.Add(row);
			}
			return(Table);
		}
	}
}
 
Originally posted by Ben
guitarnerd, stop poisoning our minds with filthy ASP!!! :cry2: :p

Umm here are a few thoughts...you are an idiot...that is C# not asp...that is not a web language...I am posting it because I copy and paste the source so I can put it on my page formatted in the pretty colors...and if that is "filthy" code you may want to consider that C# is nearly identical to C which is compatible with your crappy *nix computers. So according to you "C" is filthy making every single operating system and just about every program in the world "filthy" shut up if you don't know what you are talking about

hoe face fgt_bear
 
Originally posted by CoRN
C++ is better anyways :D

C# is an alternative to C++...and it is far more productive...as I have heard from many people...one of which programs for Microsoft himself
 
guitarnerd, I was just messing around. hence the :p smiley. Just loosen up a little bit and don't take things I say in this thread seriously. ;) Except this.
 
if you notice, everything in my sig is the exact oppiste of what it is. henceforth i am saying that windows is the exact oppoisite of stable.
 
Originally posted by sharkbyte
if you notice, everything in my sig is the exact oppiste of what it is. henceforth i am saying that windows is the exact oppoisite of stable.
What i said was opposite too:p
 
Anyone have good techniques for--you know when you have to surreptitiously scratch your -----when it itches real bad but there are a bunch of ppl around.
 
You could create a diversion. the classic line is "Look! A diversion!"

or, you could just do as I do, and go ahead and scratch anyway.


What a way for me to return to this thread, hey?
 
quote:
------------------------------------------------------------------------
Originally posted by sharkbyte
if you notice, everything in my sig is the exact oppiste of what it is. henceforth i am saying that windows is the exact oppoisite of stable.
------------------------------------------------------------------------
What i said was opposite too
cool. so which OS does everybody here at FWS like the most? personally, i like FreeBSD:p
 
Back
Top