1. How to get the fixed length of a fixed length string
Private Structure TNavRec <VBFixedString(100),System.Runtime.InteropServices.MarshalAs(System.Runtime. InteropServices.UnmanagedType.ByValTStr,SizeConst:=100)> Public strItemName As String <VBFixedString(4),System.Runtime.InteropServices.MarshalAs(System.Runtime.In teropServices.UnmanagedType.ByValTStr,SizeConst:=4)> Public strItemID As String <VBFixedString(2),System.Runtime.InteropServices.MarshalAs(System.Runtime.In teropServices.UnmanagedType.ByValTStr,SizeConst:=2)> Public EndOfLine As String End Structure --snip-- Dim ludtNavRec As TNavRec 'accept more than a record will hold cboName.Text = VB.Left(Value, Len(ludtNavRec.strItemName)) ------ In my program Len(ludtNavRec.strItemName) returns 0 (probably because I haven't stored anything into it yet). Probably returning the length of the variable string not the capacity. I could, of course, store the max length (100) in a const and use that but I wonder if there is a better way? Thanks
2. ReportViewer with fixed length text file - Asp.Net
3. Create fixed length text file
I have to create a fixed length text file and was hoping someone could point me to an example or resources that could help explain how it is done in C#. Thanks.
4. importing a fixed field length formatted text file into a dataset - VB.Net
5. Reading Fixed Length ASCII/Text File
I have the following code to read the following file (very simple).
I'm trying to extract only the date, but with this code I'm extracting
the entire record. What am I doing wrong? What am I missing?
Ken
c:\temp\namedate.txt = Ken Hall08/27/56 (One record)
Module Module1
Public Structure Record1
<VBFixedString(8)> Public name As String
<VBFixedString(8)> Public date1 As String
End Structure
Sub Main()
Try
Dim line As String
Dim Record2 As New Record1
' Create an instance of StreamReader to read from a file.
Dim sr As System.IO.StreamReader = New
System.IO.StreamReader("c:\temp\namedate.txt")
' Read and display the lines from the file until the end
' of the file is reached.
Do
line = sr.ReadLine()
Record2.date1 = line
Console.WriteLine(Record2.date1)
Loop Until line Is Nothing
sr.Close()
Catch E As Exception
' Let the user know what went wrong.
Console.WriteLine("The file could not be read:")
Console.WriteLine(E.Message)
End Try
End Sub
End Module
6. how to split a string using ,fixed character length, variable text delimmiter - CSharp/C#
7. Transform fixed length text to xml
can i transform fixed length text to xml using XSL do i have to first load the text to xml and do the transformation? is there any other way to do it?
8. problem while working with fixed length strings in Vb.Net - Microsoft .NET Framework