Entries for month: February 2008
Need some Coldfusion , HTML, CSS, Javascript or PHP Help
Posted by john
or perhaps you need some DTS Packages converted to SSIS. Drop me a line at tyrsblade [at] google mail domain. I am looking to pickup a couple small to medium sized side projects.
with the addition of the Little One a little extra cash would be nice.
Parsing large flat files with irregular delimiters
Posted by john
using System;
using System.Collections;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
namespace FileSplitter
{
class Program
{
public static void Main(string[] args)
{
if(args.Length < 4){
Console.WriteLine("Usage: ");
}
else
{
string FilePathnName = args[0];
string oFilePathnName = "Candidates";
//string oFilePathnName = "Requisitions";
string cLine = null;
string cDelim = null;
string rDelim = "<><>";
string nRow = null;
string oRow = null;
string sRow = null;
int iCount = 0;
string strBuild = null;
string sColumn = "candidatehrms_code|firstname|middlename|lastname|address1|address2|city|state|zip|countryhrms_code|email|login|password|isemployee|statushrms_code|resumertf|referraltypehrms_code|referraldetail|active|homephone<><>";
//string sColumn = "requisitionhrms_code|jobtitle|markettitle|orderdate|statusdate|createdate|internalexpires|jobcode|jobgradehrms_code|externaljobdescription|internaljobdescription|approved|statushrms_code|openings|placements|flsaexempt|fullpart|eligibleemployeereferral|wagecurrencyhrms_code|countryhrms_code|departmentshrms_code|locationhrms_code|hiringmanagerhrms_code|recruiterhrms_code|eeocodehrms_code|jobcategoryhrms_code|percenttravel|workflowhrms_code|webapproved|confidentialreq|supervisory|active|udfhirereqid|requisitiontypehrms_code|employmenttypehrms_code|incumbentname|aibtarget<><>";
StreamReader sReader = new StreamReader(FilePathnName);
StreamWriter sWriter;
while(sReader.Peek() >= 0){
sRow = sRow + sReader.ReadLine();
if(sRow.Contains("~~")){
iCount = iCount + 1 ;
string[] dRow = sRow.Split("~~".ToCharArray());
if(dRow.Length > 1){
oRow = dRow[0];
sRow = dRow[1] + dRow[2];
strBuild = strBuild + oRow + "<><>";
if(iCount == 1500){
strBuild = sColumn + strBuild;
sWriter = File.CreateText(oFilePathnName + "_" + DateTime.Now.ToString("yyyyMMdd")+ "_" + DateTime.Now.ToString("HHmmss")+ ".txt");
sWriter.Write(strBuild);
sWriter.Close();
iCount = 0;
strBuild = null;
}
else{
if(sReader.Peek() <= 0 ){
strBuild = sColumn + strBuild;
sWriter = File.CreateText(oFilePathnName + "_" + DateTime.Now.ToString("yyyyMMdd")+ "_" + DateTime.Now.ToString("HHmmss")+ ".txt");
sWriter.Write(strBuild);
sWriter.Close();
iCount = 0;
strBuild = null;
}
}
}
}
}
}
}
}
}
Now the only remaining issue is that it strips \r \n and replaces it with tabs and i have no idea why.
Song of the Moment
Posted by john
RUN THROUGH THE JUNGLE Lyrics
Artist(Band):Creedence Clearwater Revival
Whoa, thought it was a nightmare,
Lo, its all so true,
They told me, dont go walkin slow
cause devils on the loose.
Chorus:
Better run through the jungle,
Better run through the jungle,
Better run through the jungle,
Woa, dont look back to see.
Thought I heard a rumblin
Callin to my name,
Two hundred million guns are loaded
Satan cries, take aim!
Chorus
Over on the mountain
Thunder magic spoke,
Let the people know my wisdom,
Fill the land with smoke.
Chorus
sometimes work
Posted by john
makes me think of shakespeare.
Life's a walking shadow, a poor player that struts and frets his hour upon the stage and then is heard no more. It is a tale told by an idiot, full of sound and fury, signifying nothing. - William Shakespeare, Macbeth