We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

VB.net code to Read all lines in Fixed Width text file and add characters in specific locations

nemesis1210
nemesis1210 asked
on
Medium Priority
675 Views
Last Modified: 2012-05-07
I am trying to code a small application which addresses a formatting issue in a text file received every month, its a fixed width file which has dates in a specific location such as 20090701 i need to change every line to read 2009-07-01 I was thinking maybe using streamreader or the like but cant quite figure this one out
Comment
Watch Question

Commented:
You can read all the lines of the file into a string array using System.IO.File.ReadAllLines("PATH TO FILE"), then you can jsut loop through the array and adjust the lines as needed and rewrite them to the file.

Author

Commented:
any chance you can point me to some sample code
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview

Author

Commented:
Worked Perfectly thank you so much
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.