I am working on .net 4.0
In my organisation there are two file format
1)PNB and 2)ACE(need to select any one of the format to convert to respective format
if i select ACE means through file browser i have selected PNB which will convert to ACE after submitting the button
In PNB there are thousand character in one LINE which contain the data and i need to seperate and form a string and seperate this string by ,(comma) as delimiter.
I have seperate the characters to string but the problem is that the string which are formed i need to pickup from middle and then write
Following is my code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace PNB
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
S = SR.ReadLine();
while (S != null)
{
int n = numbers.Length;
SingleLine = "";
int i = 10;
while (i <= 39)
{
int a = numbers[i];
int p = numbers[i - 1] + 1;//start
int q = a - p + 1;//End
SingleLine = String.Concat(SingleLine,S.Substring(p,q));
SingleLine = String.Concat(SingleLine, ","); //above logic will seperate char to string but i want to pick up characters present at this positions 114, 15, 27, 44, 44, 316, 356, 99, 74, 591 and form a string with seperate commas and this will form a line and this line i will write in ACE format which i have specified above
and this should be for all line by line
//S = SR.ReadLine();
}
//SR.Close();
//SW.Close();
MessageBox.Show("Done");
//S = SR.ReadLine();
//SingleLine = "";
/*
int n = numbers.Length;
for (int i = 0; i < n; i++)
{
if (i == 0)
{
s = -1;
int a = numbers[i];
int b = s + 1;
int c = a - b + 1;
//Console.WriteLine("Start:\t" + b);
//Console.WriteLine("End:\n" + c);
}
else
{
//int k = numbers[i - 1];
int a = numbers[i];
int p = numbers[i - 1] + 1;//start
int q = a - p + 1;//End
//Console.WriteLine("Start:\t" + p);
//Console.WriteLine("End:\n" + q);
Bookmarks