'2019/08/12'에 해당되는 글 4건

  1. 2019.08.12 node.js regex
  2. 2019.08.12 xpath xsi
  3. 2019.08.12 postgresql 변수 타입
  4. 2019.08.12 awk NR, NF
Programming/node.js2019. 8. 12. 16:57

별다른 모듈 끌어오지 않아도 기본으로

new RegExp()를 통해 생성이 가능하다.

 

아래는 파일명에서 YYYY-MM 으로 된 녀석을 검색하는 예제

음.. 근데 딱 그 부분만 빼내는 법은 없나?

> var regex =  new RegExp('[0-9]{4}-[0-9]{2}')
undefined
> regex
/[0-9]{4}-[0-9]{2}/
> var fn = "ClinVarFullRelease_2019-07.xml"
undefined
fn.match(regex);
[ '2019-07', index: 19, input: 'ClinVarFullRelease_2019-07.xml' ]

[링크 : https://stackoverflow.com/questions/5675315/node-js-regular-expression-to-get-from-and-to]

 

+

regex.exec(fn)

[링크 : https://opentutorials.org/course/50/43]

 

+

()로 묶으면 완전히 매칭되는 부분만 결과를 돌려준다.

> var regex =  new RegExp('([0-9]{4}-[0-9]{2})')
undefined
fn.match(regex);
[ '2019-07',
  '2019-07',
  index: 19,
  input: 'ClinVarFullRelease_2019-07.xml' ]

[링크 : https://bradbury.tistory.com/47]

'Programming > node.js' 카테고리의 다른 글

node.js xpath 지원함수 목록  (0) 2019.09.10
node.js csv2json  (0) 2019.08.21
node.js xpath 모듈  (0) 2019.08.08
xpath text()  (0) 2019.08.07
node.js readline과 r/w stream  (0) 2019.07.31
Posted by 구차니
Programming/xml2019. 8. 12. 15:42

xml namespace나 schema 관련된 녀석을 조회하려는데

어떻게 해야 할지 감이 안와서(evaluation fail막 뜨고..) 찾다가 발견

name이 아니라 name()이 포인트

//*[name()='xsi:noNamespaceSchemaLocation']

 

[링크 : https://stackoverflow.com/questions/4817112/xpath-query-for-xml-node-with-colon-in-node-name]

 

xsi는 Xml Schema Instance의 약자인 것으로 보인다.

인스턴스 문서가 참조할 때는 두 가지 특별한 애트리뷰트를 사용하는데, xsi:schemaLocation xsi:noNamespaceSchemaLocation이 그것이다. 관습적으로 "xsi"는 "http://www.w3.org/2001/XMLSchema-instance"를 가리키는 접두어로 쓰인다.)

[링크 : https://ko.wikipedia.org/wiki/XML_스키마_(W3C)]

'Programming > xml' 카테고리의 다른 글

xsd minOccurs, maxOccurs  (0) 2019.09.11
xpath count()  (0) 2019.09.09
xpath concat  (0) 2019.08.08
xpath syntax - attribute 검색 및 특정값 얻기  (0) 2019.08.08
xpath..  (0) 2019.08.01
Posted by 구차니

bigint(int8) 64bit

interger(int, int4) 32bit

double precision(float8 = 64bit)

real(float4 = 32bit)

 

[링크 : https://www.postgresql.org/docs/9.2/datatype.html]

 

JSON 변수 타입 접근 연산자

-> (JSON object or array)

->> (stringigy?)

tablename->'json_key'->'json_key'

[링크 : https://blog.outsider.ne.kr/1061]

Posted by 구차니
Linux2019. 8. 12. 13:14

NR(number of Record?)

NF(number of Field?)

[링크 : https://ko.wikibooks.org/wiki/예제로_배우는_AWK/필드와_레코드]

 

The variable NF is set to the total number of fields in the input record.

[링크 : https://linux.die.net/man/1/awk]

'Linux' 카테고리의 다른 글

linux 수동 trim  (0) 2019.08.16
jq - json in linux command line  (0) 2019.08.16
smart trip temperature?  (0) 2019.08.05
uniq  (0) 2019.07.30
musl / uclibc  (0) 2019.07.15
Posted by 구차니