473,379 Members | 1,283 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Read Text File and split them to individual text file

I have requirement, that i get one big chunk of text file. This text file
will have has information, that on finding "****End of Information****", i
have to split them individual text file with our naming standard (unique id)
and create them designated folder.

This requirement should be created as a batch job and preferrably this job
should monitor the folder where one big chunk of text file lands and process
them immediately.

\\Textfile\IN folder => one big chunk text file comes here by different
source

\\Textfile\Output\yyyyddmm folder => i need to process (split) the text file
coming "IN" folder to different text files based on "End of Information"
delimiter.

I need to achieve this using dot net preferrably using Csharp. Pl. note that
i have recently started learning cSharp but has almost 6 years experience of
using Visual Basic & COM + etc.

Pl. throw any thoughts that you may want to share.

To tell you how the text file will look
unique ID : 999
Text blah blah blah blah......
something here..
some information ...
"****End of Information****"
unique ID : 999
Text blah blah blah blah......
something here..
some information ...
"****End of Information****"
unique ID : 999
Text blah blah blah blah......
something here..
some information ...
"****End of Information****"

Thanks,
Krish
Nov 19 '05 #1
1 1676
Read it in to a String
..Split() the string on ***eof*** into an array.
Loop the array and do your individual work.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Krish" wrote:
I have requirement, that i get one big chunk of text file. This text file
will have has information, that on finding "****End of Information****", i
have to split them individual text file with our naming standard (unique id)
and create them designated folder.

This requirement should be created as a batch job and preferrably this job
should monitor the folder where one big chunk of text file lands and process
them immediately.

\\Textfile\IN folder => one big chunk text file comes here by different
source

\\Textfile\Output\yyyyddmm folder => i need to process (split) the text file
coming "IN" folder to different text files based on "End of Information"
delimiter.

I need to achieve this using dot net preferrably using Csharp. Pl. note that
i have recently started learning cSharp but has almost 6 years experience of
using Visual Basic & COM + etc.

Pl. throw any thoughts that you may want to share.

To tell you how the text file will look
unique ID : 999
Text blah blah blah blah......
something here..
some information ...
"****End of Information****"
unique ID : 999
Text blah blah blah blah......
something here..
some information ...
"****End of Information****"
unique ID : 999
Text blah blah blah blah......
something here..
some information ...
"****End of Information****"

Thanks,
Krish

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Ruben | last post by:
Hello. I am trying to read a small text file using the readline statement. I can only read the first 2 records from the file. It stops at the blank lines or at lines with only spaces. I have a...
2
by: Mark Fisher | last post by:
Hi I have a database on a website, and a table in this db contains two fields, PCode, and Verified. I have to add new records to this in batches, and these batches are generated on a local PC....
3
by: Krish | last post by:
I have requirement, that i get one big chunk of text file. This text file will have has information, that on finding "****End of Information****", i have to split them individual text file with our...
5
by: Just Me | last post by:
Using streams how do I write and then read a set of variables? For example, suppose I want to write into a text file: string1,string2,string3 Then read them later. Suppose I want to write...
3
by: Ben | last post by:
Hi I am creating a dynamic function to return a two dimensional array from a delimeted string. The delimited string is like: field1...field2...field3... field1...field2...field3......
4
by: Karl | last post by:
How do you read a tab delimited text file? The file has 3 colums of data. I can read fixed width text files using the left and mid functions. I had rather not use transfer text and import specs.
24
by: garyusenet | last post by:
I'm working on a data file and can't find any common delimmiters in the file to indicate the end of one row of data and the start of the next. Rows are not on individual lines but run accross...
11
by: Eran.Yasso | last post by:
Hi All, I searched the web to see how i can read csv file (specific cells) but didn't find much. Can anyone give me a link or help how to read or write to a specific cell in csv file? Using...
5
by: dm3281 | last post by:
Hello, I have a text report from a mainframe that I need to parse. The report has about a 2580 byte header that contains binary information (garbage for the most part); although there are a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.