중복라인삭제.
- notepad++ 에서 적용
- 조건은 아래 정규식으로, 바꿀내용은 빈공백으로.
^(.*?)$\s+?^(?=.*^\1$)
end.
'Programming Language > Regular Expression' 카테고리의 다른 글
정규식을 이용한 컬럼 다수 문자 변경 (0) | 2019.10.14 |
---|
중복라인삭제.
- notepad++ 에서 적용
- 조건은 아래 정규식으로, 바꿀내용은 빈공백으로.
^(.*?)$\s+?^(?=.*^\1$)
end.
정규식을 이용한 컬럼 다수 문자 변경 (0) | 2019.10.14 |
---|
1. Chart FX 8
- main link: https://support.softwarefx.com/Chart_FX_8
- API Reference: http://support.softwarefx.com/Chart_FX_8/api
- Programmer's Guide & Samples: http://support.softwarefx.com/Chart_FX_8/article/2501002
- Samples: http://support.softwarefx.com/Chart_FX_8/samples
- 한국어 퀵가이드: http://download.softwarefx.com/CfxNet80/Chart_FX_8_Quick_Guide_Korean.pdf
2. Chart FX 7
- main link: https://support.softwarefx.com/Chart_FX_7/
- API Reference: https://support.softwarefx.com/Chart_FX_7/api
- Programmer's Guide & Samples: https://support.softwarefx.com/Chart_FX_7/article/2501002
- Samples: https://support.softwarefx.com/Chart_FX_7/samples
end.
NLog 사용 샘플 (0) | 2020.04.25 |
---|---|
[펌] Correlation of two arrays in C# (0) | 2020.02.06 |
remove comments with C# (0) | 2019.10.14 |
excel upload faster (0) | 2019.10.14 |
c# 관련사이트 (0) | 2019.10.14 |
# remove comments with C#
using System;
using System.Text;
using System.Windows.Forms;
namespace WFRemoveComment
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnRemoveComment_Click(object sender, EventArgs e)
{
string s = System.IO.File.ReadAllText(@"C:\workspace_cs\WindowsFormsApp1\WindowsFormsApp1\Form1.cs");
this.rtxText1.Text = s;
this.rtxText2.Text = removeComment(s);
}
public static string removeCommentStyleJava(string s)
{
char lineCommentChar1 = '/';
char lineCommentChar2 = '/';
return removeComment(s, lineCommentChar1, lineCommentChar2);
}
public static string removeCommentStyleSql(string s)
{
char lineCommentChar1 = '-';
char lineCommentChar2 = '-';
return removeComment(s, lineCommentChar1, lineCommentChar2);
}
public static string removeComment(string s, char lineCommentChar1 = '/', char lineCommentChar2 = '/')
{
StringBuilder endResult = new StringBuilder(1000);
const int outsideComment = 0;
const int insideLineComment = 1;
const int insideblockComment = 2;
int currentState = outsideComment;
if(s == null)
{
return endResult.ToString();
}
char c = (char) 0;
char c2 = (char)0;
for(int i = 0, cnt = s.Length; i < cnt; i++)
{
c = s[i];
switch (currentState)
{
case outsideComment:
if (c == lineCommentChar1 && (i+1) < cnt)
{
c2 = s[++i]; // 다음건 read
if (c2 == lineCommentChar2)
currentState = insideLineComment;
else if (c2 == '*')
currentState = insideblockComment;
else
endResult.Append(c).Append(c2);
}
else
endResult.Append(c);
break;
case insideLineComment:
if (c == '\r')
endResult.Append(c);
if (c == '\n')
{
currentState = outsideComment;
endResult.Append(c);
}
break;
case insideblockComment:
if (c == '\r' || c == '\n')
endResult.Append(c);
if (c == '*' && (i+1) < cnt)
{
c2 = s[++i]; // 다음건 read
if (c2 == '/')
{
currentState = outsideComment;
break;
}
}
break;
} // end of switch
} // end of for
return endResult.ToString();
}
}
}
end.
[펌] Correlation of two arrays in C# (0) | 2020.02.06 |
---|---|
ChartFX Help (0) | 2020.01.19 |
excel upload faster (0) | 2019.10.14 |
c# 관련사이트 (0) | 2019.10.14 |
Highlight Textbox (0) | 2019.10.14 |
참조사이트
Normal ConnectionString : (work for xls files)
Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};Extended Properties=\"Excel 8.0;HDR=YES;\""
Office 2007 ConnectionString : (work for xlsx files)
Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=\"Excel 12.0;HDR=YES;\""
private void UseOlebForLoadExcel()
{
string filePath = "C:\\99.download\\샘플.xlsx";
int nOutputRow = 0;
string sSheetName = null;
string sConnection = null;
DataTable dtTablesList = default(DataTable);
OleDbCommand oleExcelCommand = default(OleDbCommand);
OleDbDataReader oleExcelReader = default(OleDbDataReader);
OleDbConnection oleExcelConnection = default(OleDbConnection);
sConnection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source="+ filePath + ";Extended Properties=\"Excel 12.0;HDR=No;IMEX=1\"";
oleExcelConnection = new OleDbConnection(sConnection);
oleExcelConnection.Open();
dtTablesList = oleExcelConnection.GetSchema("Tables");
if (dtTablesList.Rows.Count > 0)
{
SheetName = dtTablesList.Rows[0]["TABLE_NAME"].ToString();
}
dtTablesList.Clear();
dtTablesList.Dispose();
if (!string.IsNullOrEmpty(sSheetName))
{
oleExcelCommand = oleExcelConnection.CreateCommand();
oleExcelCommand.CommandText = "Select * From [" + sSheetName + "]";
oleExcelCommand.CommandType = CommandType.Text;
oleExcelReader = oleExcelCommand.ExecuteReader();
nOutputRow = 0;
while (oleExcelReader.Read())
{
// reader.GetDouble(0);
var index = grid.Rows.Add();
grid.Rows[index].Cells["filePath"].Value = oleExcelReader.GetString(0);
grid.Rows[index].Cells["fileName"].Value = oleExcelReader.GetString(0);
grid.Rows[index].Cells["lineNo"].Value = oleExcelReader.GetString(0);
grid.Rows[index].Cells["fileCnts"].Value = oleExcelReader.GetString(0);
}
oleExcelReader.Close();
}
oleExcelConnection.Close();
}
ChartFX Help (0) | 2020.01.19 |
---|---|
remove comments with C# (0) | 2019.10.14 |
c# 관련사이트 (0) | 2019.10.14 |
Highlight Textbox (0) | 2019.10.14 |
Visual Studio Installer 를 이용한 배포(Deployment) (0) | 2019.10.14 |