Hi Everyone in todays post, I will explore the Line Endings or End of Line (EOL) in different system and how to identify them -
HEXADECIMAL View of Text File Created in WINDOWS system
Hi Everyone in todays post, I will explore the Line Endings or End of Line (EOL) in different system and how to identify them -
Hi Guys, in this post I will explore how JavaScript came into existence, as we all know, JavaScript is the world's most popular programming language, its good to know its history and it goes as below -
JavaScript is a client side scripting language developed by Brendan Eich of Netscape Corporations under the name Mocha.
Mocha was later renamed to LiveScript, and then finally to JavaScript mainly as was it was influenced by the Java programming language.
LiveScript was the official name when it first shipped in beta releases of Netscape Navigator 2.0 in September 1995, it was renamed JavaScript in a joint announcement with Sun Microsystems on December 4, 1995 when it was deployed in the Netscape browser version 2.0 .
The change of name from LiveScript to JavaScript coincided with Netscape adding support for Java technology in its Netscape Navigator web browser.
|
XML |
JSON |
|
You need message validation |
You don't need Messages to be validated |
|
XML transfer is slower then
JSON since the file size is relatively compared to JSON. |
JSON is a good if you want to transmit data faster
from client to server, due to reduced file size |
|
You need to transform the XML i.e.
if using XSLT |
You're not transforming messages, or transforming
their de serialization is simple |
|
Your messages include a lot of marked-up text |
Your messages are mostly data, not marked-up text |
|
You need to interoperate with environments that
don't support JSON |
The messaging endpoints have good JSON tools |
|
Used when objective is to carry or store data |
Used when objective is to display the Data |
|
When there is no concern for reduced file/transfer
size. |
When there is a requirement for reduced
file/transfer size. |
|
Processing is slower since XML has
to be parsed with XML parser. |
Processing is faster since JSON can be parsed by a
standard JavaScript function. |
Sl No
|
Library
|
Type
|
Remarks
|
1
|
iText
|
Paid
|
|
2
|
BitMiracle
|
Paid
|
|
3
|
FreeSpire.PDF
|
Free
|
Page limit
per pdf is limited to 10 Pages in the Free version
|
4
|
Spire.PDF
|
Paid
|
Code to Read Excel and Store into Data Table using C#
|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.OleDb;
namespace
ReadExcelFileIntoDataSetInCSharp
{
class Program
{
static
void Main(string[]
args)
{
String
file_path = "C:\\ExcelData.xlsx";
String
excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data
Source=" + file_path + ";Extended
Properties=Excel 12.0;Persist Security Info=False";
OleDbConnection
excelConnection = new OleDbConnection(excelConnectionString);
DataTable
dataTableObj = new DataTable("ExcelDataTable");
OleDbDataAdapter
adp = new OleDbDataAdapter("SELECT [SLNo],[Name],[Age] FROM [Sheet1$]",
excelConnectionString);
adp.Fill(dataTableObj);
excelConnection.Close();
}
}
} |
Sample Code
to Write Unix Type File in C#
|
using System;
using System.Text;
using System.IO;
namespace UnixFile
{
class Program
{
static
void Main(string[]
args)
{
//Data
for the text file, is stored inside a string array
string[]
lines = { "First Line", "Second Line" };
//Variable
fileDetails contains the file name and path
String
fileNameAndPath = "C:\\Sample Text
File.txt";
//Below
line of code will delete the file if it already exists (OPTIONAL)
if (File.Exists(fileNameAndPath)) { File.Delete(fileNameAndPath); }
using
(TextWriter objFile = new StreamWriter(fileNameAndPath))
{
//Set
the New line Property to Unix type of New line
objFile.NewLine = "\n";
objFile.WriteLine(lines[0]);
objFile.WriteLine(lines[1]);
}
}
}
}
|