Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

JasonLee07

@JasonLee07
About
Posts
5
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • So I gave a dev a choice yesterday
    J JasonLee07

    What kind of developer chooses documentation over development?

    The Lounge csharp collaboration career

  • Streamreader, Stringbuilder, and Stream or Stringwriter
    J JasonLee07

    Thanks for the steps and showing the difference between the different classes. Below is what I have so far and I think it will work. My new file contained the 111222333 string for all the missing data which was the desired result. Thanks, Jason StreamReader sr = File.OpenText("C:\\Source.txt"); StreamWriter sw = File.CreateText("C:\\Test1.txt"); while (sr.Peek() != -1) { string strRecord = sr.ReadLine(); string strSurname = strRecord.Substring(0, 10); string strFirstName = strRecord.Substring(11, 8); string strPupilNum = strRecord.Substring(20, 9).Trim(); string strSSID = strRecord.Substring(373, 9).Trim(); if (strPupilNum == String.Empty) { // call db stored procedure to retrieve PupilNum based on SSID StringBuilder sb = new StringBuilder(strRecord); sb.Remove(20, 9); sb.Insert(20, "111222333", 1); strRecord = sb.ToString(); } sw.WriteLine(strRecord); } sw.Close();

    C# database

  • Is there a way to get a list of all exceptions that can be thrown by a program....
    J JasonLee07

    Hope I'm not asking a dumb question but is the code you're executing within a try / catch block? Second question is do you what is causing the exception yet?

    C# help csharp testing debugging beta-testing

  • PDF Generation
    J JasonLee07

    Just my 2c, I found itextSharp very easy to implement.

    C# database help question

  • Streamreader, Stringbuilder, and Stream or Stringwriter
    J JasonLee07

    I have done plenty of googling and have gotten close to a solution but wanted to make sure I'm going about it the right way. I have a data file which is a non delimited fixed field position file that has missing data. I basically want to read each line in and determine if a certain field is blank. If so I use another field in that same record to retrieve the missing data from the database. After getting the missing value I would like to use StreamWriter or StringWriter (not sure which) to write out each line to a new file with the updated field value. Appreciate any advice you all may have on this subject. Thanks, Jason

    C# database
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups