IT/인터넷 마케팅2021. 3. 9. 21:45
반응형

쿠팡 파트너스 아이디 추천이 없을때 사용 하세요

 

AF2747484

 

이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받을 수 있습니다.

반응형
Posted by Dream Come True
IT/인터넷 마케팅2021. 2. 24. 21:29
반응형

python 엑셀 자동화 [업무자동화]

 

xlsxwriter 와 pandas 를 활용한 엑셀 업무 자동화

pandas 설치

pip install pandas

 

import pandas as pd
import numpy as np

# Sample DataFrame
df = pd.DataFrame(np.random.randn(5, 4), columns=['one', 'two', 'three', 'four'],
                  index=['a', 'b', 'c', 'd', 'e'])

# Dump Pandas DataFrame to Excel sheet
writer = pd.ExcelWriter('myreport.xlsx', engine='xlsxwriter')
df.to_excel(writer, sheet_name='Sheet1', startrow=2)

# Get book and sheet objects for futher manipulation below
book = writer.book
sheet = writer.sheets['Sheet1']

# Title
bold = book.add_format({'bold': True, 'size': 24})
sheet.write('A1', 'My Report', bold)

# Color negative values in the DataFrame in red
format1 = book.add_format({'font_color': '#E93423'})
sheet.conditional_format('B4:E8', {'type': 'cell', 'criteria': '<=', 'value': 0, 'format': format1})

# Chart
chart = book.add_chart({'type': 'column'})
chart.add_series({'values': '=Sheet1!B4:B8', 'name': '=Sheet1!B3', 'categories': '=Sheet1!$A$4:$A$8'})
chart.add_series({'values': '=Sheet1!C4:C8', 'name': '=Sheet1!C3'})
chart.add_series({'values': '=Sheet1!D4:D8', 'name': '=Sheet1!D3'})
chart.add_series({'values': '=Sheet1!E4:E8', 'name': '=Sheet1!E3'})
sheet.insert_chart('A10', chart)

writer.save()

 

반응형
Posted by Dream Come True
IT/인터넷 마케팅2020. 12. 17. 22:18
반응형

github.com/kuimoani/defold/wiki/CREATE%20WITH%20DEFOLD

 

kuimoani/defold

translate defold manual to Korean. Contribute to kuimoani/defold development by creating an account on GitHub.

github.com

 

반응형
Posted by Dream Come True
IT2020. 12. 10. 21:41
반응형
변환

sed 's/|//g' access.log > access1.log  
:  access.log 파일에서 "|" 해당 문자를 "" 공백으로 변환하여, access1.log 파일로 저장한다.

sed 's/GET/"GET/g'  
: GET 문자열을 "GET 로 변환


삭제

sed '/blue/d' test.txt    
: test.txt 파일에서 blue 문자가 포함된 줄을 삭제 하여 출력한다.

sed '/img/!d' test.txt      
: img 문자가 있는 줄만 지우지 않는다.

sed '1,2d' test.txt      
: 처음 1줄, 2줄을 지운다

sed '^$/d test.txt       
: 공백라인을 삭제한다.

 

##### sed 명령을 여러개 할 경우 -e 옵셥으로 여러게 하면 된다.

sed -e " -e " -e "

# 텍스트 가운데로 옮기기
sed -e :a -e 's/^.\{1,77\}$/ & /;ta' # method 1
sed -e :a -e 's/^.\{1,77\}$/ &/;ta' -e 's/\( *\)\1/\1/' # method 2

# substitute (find and replace) "foo" with "bar" on each line
# foo 를 bar로 교체
# 첫번째 매치를 교체
sed 's/foo/bar/' # replaces only 1st instance in a line
# 네번째 매치를 교체
sed 's/foo/bar/4' # replaces only 4th instance in a line
# 모든 매치를 교체
sed 's/foo/bar/g' # replaces ALL instances in a line
sed 's/\(.*\)foo\(.*foo\)/\1bar\2/' # replace the next-to-last case
sed 's/\(.*\)foo/\1bar/' # replace only the last case
# baz 가 있는 줄만 foo를 bar 로 교체
sed '/baz/s/foo/bar/g'
# baz가 없는 줄만 foo를 bar 로 교체
sed '/baz/!s/foo/bar/g'
# 다섯 줄마다 빈줄 더하기
gsed '0~5G' # GNU sed only
sed 'n;n;n;n;G;' # other seds

#윈도우에서 유닉스 포맷을 윈도우 포맷으로 교환
sed "s/$//" # method 1
sed -n p # method 2


# IN UNIX ENVIRONMENT: convert Unix newlines (LF) to DOS format.
# 유닉스 포맷을 윈도우 포맷으로 교환
sed "s/$/`echo -e \\\r`/" # command line under ksh
sed 's/$'"/`echo \\\r`/" # command line under bash
sed "s/$/`echo \\\r`/" # command line under zsh
sed 's/$/\r/' # gsed 3.02.80 or higher


FILE SPACING:
파일 빈공간 붙이기

# double space a file
# 두줄 만들기
sed G

# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.

sed '/^$/d;G'

# triple space a file
# 세줄 만들기
sed 'G;G'

# undo double-spacing (assumes even-numbered lines are always blank)
# 두줄 만들기 취소
sed 'n;d'

# insert a blank line above every line which matches "regex"
# 매치된 정규식 표현위에 빈줄 넣기
sed '/regex/{x;p;x;}'

# insert a blank line below every line which matches "regex"
# 매치된 정규식 표현밑에 빈줄 넣기
sed '/regex/G'

# insert a blank line above and below every line which matches "regex"
# 매치된 정규식 표현 위,아래로 빈줄 넣기
sed '/regex/{x;p;x;G;}'

반응형

'IT' 카테고리의 다른 글

python 스토어 가격 가저오기  (491) 2022.03.31
KDE Mouse 스크롤 줄수 설정 방법  (7) 2021.07.11
컴퓨터 위급사항시 필요 복구 시디  (0) 2020.12.01
manjaro(만자로) screenfetch  (0) 2020.12.01
게임 어몽어스 Among us  (151) 2020.11.29
Posted by Dream Come True