Click here to Skip to main content
15,353,676 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello
can you please help me to create a App To extract ID's from Text Files and make output to CSV, Excel,Access or any format can handle two columns the 1st for the ID and the Second to the name of the File Contained the ID.

Example of ID's is
013-2255
013-5415
013-5154

all start with "013" the "-" the four Numbers
Posted
Updated 12-Dec-12 1:07am
v2
Comments
Mendor81 12-Dec-12 5:48am
   
Have you tried to code something? If not, we're not here to do your homework. First try it yourself, and if you're having troubles come back with a piece of code and we help you
Ahmed Fawzi 12-Dec-12 7:18am
   
Thank you "Mendor81" for your reply.
and i ask for help if you don't need to help me thank you any way. i Will appreciate any guide or comment help me and save time,

Thank you
OriginalGriff 12-Dec-12 5:59am
   
This is not a good question - we cannot work out from that little what you are trying to do.
We can't really help you at all based on that information.
We have no idea what your files contain, what your IDs look like, or where the files are.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
sariqkhan 12-Dec-12 7:07am
   
:laugh
really
OG sir can you help me out with this
http://www.codeproject.com/Questions/507667/passingplusdataplusfromplusdynamicpluscontrolplust
OriginalGriff 12-Dec-12 10:26am
   
Sorry - I had to go to the dentist! You all sorted now - I notice it is marked Solved?
Ahmed Fawzi 12-Dec-12 7:13am
   
1st thank you "OriginalGriff" for your comment
My ID example look like this
Example of ID's is
013-2255
013-5415
013-5154

all start with "013" the "-" the four Numbers

and in this time my task to search in all this text to collect the Id's
i try to create application using C# but i just a beginner so i try to ask the expert to help me,
can you please just guide me to start work on application like that
thank you
adriancs 12-Dec-12 8:09am
   
You can ask someone to create the application for you at www.freelancer.com
There are lots of folks ready to create any application for you, with or without source code.

The answers that you are looking for cannot be fully answered in one reply. What we can provide you are hints.

Here are some of the hints:

First, for locating the IDs in a text file:
You can use some of the combination of the techniques below:
1. string.IndexOf(string)
2. string.SubString()
3. string.Contains()
4. as suggested by CodeNinja: [How to: Search Strings Using Regular Expressions]
This might takes you couple of days (whole day) to study it.

Next, about exporting data to Excel.
There are various of ways to export data to an Excel File. What I can recall is:
1. Using Excel.Interop
2. Using OleDB
3. Using 3rd party DLL
- NPOI - Export to Excel 2003 (xls)
- CloseXML - Export to Excel 2007/2010 (xlsx)
- OpenXML (Microsoft) - Export to Excel 2007/2010 (xlsx)
for more options: http://stackoverflow.com/questions/444522/import-and-export-excel-what-is-the-best-library[^]
4. For a quick and easy reference, you may search through the source code of this project: http://simpb.codeplex.com
- SimPB has a function of exporting data into CVS and Excel, you can copy & the paste the code for your own use.
5. You can export the data and make it as a HTML table file, but save the file extension as .xls. Microsoft Excel will automatically convert it into Excel.

Next, about exporting to CVS.
For fast solution, you may just copy and paste the code from http://simpb.codeplex.com. The codes are written inside the project. You may try to find it.
There are lots of 3rd party tools that you can use. You can find it in codeproject.

Next, about exporting to Access.
I never done this before, but I know that you can do it with OleDB.

Each of the component mentioned above will take you couple of days(8 hours a day) to study and implement it in your project. You should be able to accomplish what you want in a week of time.

Where is the link? Google can easily tell. If you can't locate it, post it in comment.
   
v6
1. Read each line from the text file.
2. Replace "-" with "," using String.replace command
e.g. eachLine = eachLine.Replace("-", ",");
3. Add these lines to a new text file with extension CSV
4. After creating CSV file, just double click the file, it will open in Excel with data in 2 columns
5. If you want the column headers, just add the following line to the CSV file as first line
ID,Name
   
Regex
--Sj
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900