Skip to main content

Posts

Showing posts with the label Sed

Notes on regex sed, bash DOM html, meta tag

Using bash tool sed, awk, grep, vim ... to edit multiple file. Case study DOM tag <html DOCTYPE, meta, charset... https://unix.stackexchange.com/questions/26284/how-can-i-use-sed-to-replace-a-multi-line-string Sed cheatsheet https://gist.github.com/asenchi/2291903 HTML meta tags (recommend way ?) https://www.quackit.com/html_5/tags/html_meta_tag.cfm Example <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml " xml:lang="ja" lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html" charset="EUC-JP" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta name="description" content="content here" ...

Sed Awk Bash

awk -F ' ' '{ a[$5]++ } END { for (b in a) { print b } }' dm_documents_resource.sql cut uniq column 5 tach boi ‘\ ‘ ‘ ‘ dau cach pfccdlfdtte pcaccplircdt dklpcfrp?qeiq lhpqlipqeodf gpwafopwprti izxndkiqpkii krirrifcapnc dxkdciqcafmd vkfpcadf. [ Code shift 1 ,2 - n word in †´˜Ã§Ã¥´¨≥ç®ÃŸ®∫˚∆Å“∑≥æç©≥Ï€÷´Ã¸˙¨ - 2 shift add position "Sometimes you can have the smallest role in the smallest production and still have a big impact." \ find . -name .svn -exec rm -rf {} \; http://blog.alexgalmeanu.com/ ------------------------- Sort de cut duplicate row (one column same value): $ sort -t, -u -b -k1n text 542 , 8 , 1 , 418 , 1 542 , 9 , 1 , 418 , 1 199 , 7 , 1 , 419 , 10 301 , 34 , 1 , 689070 , 1 It is not sorting based on the first column. Approach 2 $ sort -t, -u -b -k1n, 1n text 199 , 7 , 1 , 419 , 10 301 , 34 , 1 , 689070 , 1 542 , 8 , 1 , 418 , 1 ••••••••••••••••••••••••••• Sort cá»™t cần dùng cho lên Ä‘ầu...