Click here to Skip to main content
15,899,026 members
Home / Discussions / C#
   

C#

 
GeneralFetching meta data of MS Office files [modified] Pin
sachinkalse16-Apr-08 21:36
sachinkalse16-Apr-08 21:36 
GeneralRe: Fetching meta data of MS Office files Pin
Member 769142521-Feb-11 1:10
Member 769142521-Feb-11 1:10 
QuestionHow to open a XML file without validating? Pin
Hariharan210516-Apr-08 20:25
Hariharan210516-Apr-08 20:25 
AnswerRe: How to open a XML file without validating? Pin
pmarfleet16-Apr-08 22:39
pmarfleet16-Apr-08 22:39 
GeneralRe: How to open a XML file without validating? Pin
Hariharan210517-Apr-08 3:30
Hariharan210517-Apr-08 3:30 
General[Message Deleted] Pin
wwwxyz16-Apr-08 20:18
wwwxyz16-Apr-08 20:18 
GeneralRe: write to a txt file Pin
Reelix16-Apr-08 20:36
Reelix16-Apr-08 20:36 
GeneralRe: write to a txt file Pin
wwwxyz17-Apr-08 6:33
wwwxyz17-Apr-08 6:33 
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

class TextFile
{
public static void Main(string[] args)
{
string inFile;
string yazi;

Console.WriteLine("filename input");
Console.WriteLine("Sample: d:\\filename.LOG");
inFile = Convert.ToString(Console.ReadLine());

StreamReader dosyaOku = File.OpenText(inFile);
yazi = dosyaOku.ReadLine();

string onEk = " Frequencies -- ";
int i = 1;
string[] parcalar = null;
while (yazi != null)
{
if (yazi.StartsWith(onEk))
{
string gecici = yazi.Replace(onEk, "");
parcalar = gecici.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
Console.WriteLine(string.Format("{0}\n{1}\n{2}", parcalar[0], parcalar[1], parcalar[2]));
i++;
}
yazi = dosyaOku.ReadLine();

}
Console.ReadLine();
dosyaOku.Close();
StreamWriter sw = new StreamWriter(@"C:\filename.LOG");
sw.WriteLine(string.Format("{0}\n{1}\n{2}", parcalar[0], parcalar[1], parcalar[2]));
i++;
sw.Flush();
sw.Close();
}

firstly thanks for help you. now it is saving only one line to file:
1093.5623 1094.7121


called file contents:

Frequencies -- 1093.5623 1094.7121
Red. masses -- 6.4909 1.3756
Frc consts -- 4.5735 0.9713
Frequencies -- 0.0002 0.0400
Raman Activ -- 0.0000 0.0000
Depolar (P) -- 0.7162 0.6260
Frequencies -- 0.8346 0.7700

output data
1093.5623
1094.7121
0.0002
0.0400
0.8346
0.7700

I want to write to a file as a column "OUTPUT DATAS"
GeneralRe: write to a txt file Pin
John_Adams16-Apr-08 20:40
John_Adams16-Apr-08 20:40 
GeneralRe: write to a txt file Pin
phannon8616-Apr-08 21:59
professionalphannon8616-Apr-08 21:59 
GeneralDownloading problem using c sharp Pin
Kashif Sabir16-Apr-08 19:24
Kashif Sabir16-Apr-08 19:24 
GeneralRe: Downloading problem using c sharp Pin
Expert Coming16-Apr-08 19:39
Expert Coming16-Apr-08 19:39 
QuestionTechnology Choice? Pin
Expert Coming16-Apr-08 19:23
Expert Coming16-Apr-08 19:23 
AnswerRe: Technology Choice? Pin
Thomas Stockwell17-Apr-08 1:16
professionalThomas Stockwell17-Apr-08 1:16 
QuestionHow to get the last day of the month. Pin
dougins16-Apr-08 19:15
dougins16-Apr-08 19:15 
GeneralRe: How to get the last day of the month. Pin
Expert Coming16-Apr-08 19:19
Expert Coming16-Apr-08 19:19 
GeneralRe: How to get the last day of the month. Pin
Luc Pattyn17-Apr-08 0:19
sitebuilderLuc Pattyn17-Apr-08 0:19 
Questionchanging the image DPI keeping the same size Pin
Faysal16-Apr-08 18:41
Faysal16-Apr-08 18:41 
GeneralRe: changing the image DPI keeping the same size Pin
Rojan Gh.16-Apr-08 19:05
professionalRojan Gh.16-Apr-08 19:05 
QuestionRe: changing the image DPI keeping the same size Pin
Faysal17-Apr-08 1:07
Faysal17-Apr-08 1:07 
AnswerRe: changing the image DPI keeping the same size Pin
Rojan Gh.17-Apr-08 5:05
professionalRojan Gh.17-Apr-08 5:05 
QuestionWebBrowser question Pin
Rojan Gh.16-Apr-08 18:34
professionalRojan Gh.16-Apr-08 18:34 
GeneralRe: WebBrowser question Pin
Luc Pattyn17-Apr-08 0:20
sitebuilderLuc Pattyn17-Apr-08 0:20 
AnswerRe: WebBrowser question Pin
Rojan Gh.17-Apr-08 4:43
professionalRojan Gh.17-Apr-08 4:43 
QuestionWorking with percentages in C# Pin
dougins16-Apr-08 18:21
dougins16-Apr-08 18:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.