Click here to Skip to main content
15,923,120 members
Home / Discussions / C#
   

C#

 
GeneralRe: Hide data column instead of remove column in dataset Pin
cocoonwls17-Apr-08 21:34
cocoonwls17-Apr-08 21:34 
Questionhow to handle click event of DataGridViewLinkColumn in DataGridView - C# Windows project Pin
NarVish17-Apr-08 18:23
NarVish17-Apr-08 18:23 
AnswerRe: how to handle click event of DataGridViewLinkColumn in DataGridView - C# Windows project Pin
Razvan Dimescu17-Apr-08 20:10
Razvan Dimescu17-Apr-08 20:10 
AnswerRe: how to handle click event of DataGridViewLinkColumn in DataGridView - C# Windows project Pin
tamojit Mondal6-Jan-10 21:53
tamojit Mondal6-Jan-10 21:53 
GeneralHelp in C # Pin
zidan91117-Apr-08 18:20
zidan91117-Apr-08 18:20 
GeneralRe: Help in C # Pin
Christian Graus17-Apr-08 19:41
protectorChristian Graus17-Apr-08 19:41 
GeneralRe: Help in C # Pin
Rob Smiley18-Apr-08 10:35
Rob Smiley18-Apr-08 10:35 
QuestionHow to check whether Datetime value is null Pin
YAI17-Apr-08 18:11
YAI17-Apr-08 18:11 
AnswerRe: How to check whether Datetime value is null Pin
Christian Graus17-Apr-08 19:42
protectorChristian Graus17-Apr-08 19:42 
GeneralRe: How to check whether Datetime value is null Pin
YAI17-Apr-08 20:48
YAI17-Apr-08 20:48 
AnswerRe: How to check whether Datetime value is null Pin
Luc Pattyn17-Apr-08 21:11
sitebuilderLuc Pattyn17-Apr-08 21:11 
GeneralNullReferenceException when using Delegate Pin
cocoonwls17-Apr-08 15:30
cocoonwls17-Apr-08 15:30 
GeneralRe: NullReferenceException when using Delegate Pin
Christian Graus17-Apr-08 15:37
protectorChristian Graus17-Apr-08 15:37 
GeneralRe: NullReferenceException when using Delegate Pin
cocoonwls17-Apr-08 16:12
cocoonwls17-Apr-08 16:12 
GeneralRe: NullReferenceException when using Delegate Pin
Christian Graus17-Apr-08 16:22
protectorChristian Graus17-Apr-08 16:22 
GeneralMadness? IDisposable and template/factory methods Pin
Roger Alsing17-Apr-08 12:44
Roger Alsing17-Apr-08 12:44 
QuestionI am getting 0x00000096 type messages. Pin
dougins17-Apr-08 11:45
dougins17-Apr-08 11:45 
AnswerRe: I am getting 0x00000096 type messages. Pin
dougins17-Apr-08 11:58
dougins17-Apr-08 11:58 
QuestionHow to change the "Close" text string which is displayed when the user hovers over the Windows Form ControlBox 'X' Close button Pin
jack8091817-Apr-08 10:08
jack8091817-Apr-08 10:08 
AnswerRe: How to change the "Close" text string which is displayed when the user hovers over the Windows Form ControlBox 'X' Close button Pin
Ravenet17-Apr-08 15:41
Ravenet17-Apr-08 15:41 
QuestionConfig file in DLL C# projects Pin
ARol17-Apr-08 9:15
ARol17-Apr-08 9:15 
Generalthe problem write to file is still continuing:( Pin
wwwxyz17-Apr-08 8:52
wwwxyz17-Apr-08 8:52 
GeneralRe: the problem write to file is still continuing:( Pin
wwwxyz17-Apr-08 11:21
wwwxyz17-Apr-08 11:21 
GeneralRe: the problem write to file is still continuing:( Pin
BoneSoft17-Apr-08 11:49
BoneSoft17-Apr-08 11:49 
GeneralRe: the problem write to file is still continuing:( Pin
wwwxyz17-Apr-08 19:41
wwwxyz17-Apr-08 19:41 
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

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

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

StreamReader sr = File.OpenText(inFile);
writing = sr.ReadLine();

string onEk = " Frequencies -- ";
int i = 1;
string[] parts = null;
StreamWriter sw = new StreamWriter(@"C:\filename.LOG");
while (writing != null)
{
if (writing.StartsWith(onEk))
{
string transient = writing.Replace(onEk, "");
parts = transient.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
//Console.WriteLine(string.Format("{0}\n{1}\n{2}", parts[0], parts[1], parts[2]));
//i++;
sw.WriteLine(string.Format("{0}\n{1}\n{2}", parts[0], parts[1], parts[2]));
i++;
sw.Flush();
}
writing = sr.ReadLine();

}
Console.ReadLine();
sr.Close();
sw.Close();
}


}

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
THANKS for reply
Finally It is writing to FILE all the line but as a line. morever there is square-zero between each two number.how can we do only one column them?

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.