Sponsored Content
Full Discussion: [awk]Chinese words!!
Top Forums Programming [awk]Chinese words!! Post 302948181 by RudiC on Friday 26th of June 2015 01:56:05 PM
Old 06-26-2015
Well, I tried this on a download of google.hk, and it spat out an unreadable (to western eyes) line...:
Code:
awk '{for (i=1; i<=NF; i++) if ($i >= "\344" && $i <= "\351") {printf "%s", $i$(i+1)$(i+2); i+=2}}' FS="" file
搜尋圖片地圖新聞更多登入香港中顯示的語言為中文简体私隱權政策條款設定廣告企業關於

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract numbers below words with awk

Hi all, Please some help over here. I have a Sales.txt file containing info in blocks for every sold product in the pattern showed below (only for 2 products). NEW BLOCK SALE DATA PRODUCT SERIAL 79833269999 146701011945004 .Some other data .Some... (17 Replies)
Discussion started by: cgkmal
17 Replies

2. Shell Programming and Scripting

awk after words

hi sorry, newbie for scripting.. the text file: abcdefghijk%%$%^U^%234454234 I got awk script: awk ' ($1 == "abcd") the output only show: abcd I tried using asterix: awk ' ($1 == "abcd*") but same output abcd only... how can I get all of the line ?? (6 Replies)
Discussion started by: flekzout
6 Replies

3. Shell Programming and Scripting

How to get a known word between two known words using awk

hi I have posted it earlier but i was unable to put my exact problem.This time posting in parts. I have a text file which i had transferred to UNIX.It has strings like: alter table table_name add (column_name); as well as modify options. now i need to read the table name between alter... (3 Replies)
Discussion started by: alisha
3 Replies

4. Shell Programming and Scripting

using the $1 $2 etc for words in awk

So if I have an awk statement that is basically just looking at the NF at if its more than 2, then print out the first 2 words, and all the rest on another line. I know that $1 and $2 are the first two fields, but how would I symbolise telling it to print all the other fields regardless of how many... (11 Replies)
Discussion started by: linuxkid
11 Replies

5. Shell Programming and Scripting

search several words with awk command

Hello, I want to test if i find the word CACCIA AND idlck in a file, i have to print a message Ok. For that , i need to user a awk command with a && logical. Can you help me ? :confused: ### CACCIA: DEBUT ### if $(grep -wqi "$2" /etc/passwd); then && rm /etc/security/.idlck ... (3 Replies)
Discussion started by: khalidou13
3 Replies

6. Shell Programming and Scripting

search for a pattern using awk between two words

Hi, how can we search for a pattren between two words? below are the examples input 1)select from table_name c1,c2,c3,c4,fn(),fn2(),c5;-->false 2)select from table_name c1,c2,c3,c4;--True 3)select from table c1, c2, c3, fn(), c4;-->true 4)select from table_name c1, c2, c3;-->true... (11 Replies)
Discussion started by: manasa_vs
11 Replies

7. UNIX for Advanced & Expert Users

Need help either with awk or sed to get text between words

Hello All, My requirement is to get test between two words START & END, something like html tags Eg. Input file: START Line1 Line2 Line3 CLOSE START Line4 Line5 Line6 END START Line7 START Line8 (7 Replies)
Discussion started by: konerusuneel
7 Replies

8. Shell Programming and Scripting

AWK count letters words

Hi All! can anyone help me with this code? I want to count words or letters in every line with if(count>20){else echo $myline} awk '/<script /{p=1} /<\/script>/{p=0; next}!p' index.html | while read myline; do echo $myline done Thank you !!! (3 Replies)
Discussion started by: sanantonio7777
3 Replies

9. Shell Programming and Scripting

Count words/lines between two tags using awk

Is there an efficient awk that can count the number of lines that occur in between two tags. For instance, consider the following text: <s> Hi PP - my VBD - name DT - is NN - . SENT . </s> <s> Her PP - name VBD - is DT - the NN - same WRT - . SENT - </s> I am interested to know... (4 Replies)
Discussion started by: owwow14
4 Replies

10. Shell Programming and Scripting

Permutation Words in awk

i have 13 different words. I need to get permutations like all combinations of this words: word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 word13 But the combinations only should be 12 words long. Is there a fast efficient way to do this? Maybe with linux tool... (1 Reply)
Discussion started by: watcherpro
1 Replies
COMBINE_TESSDATA(1)													       COMBINE_TESSDATA(1)

NAME
combine_tessdata - combine/extract/overwrite Tesseract data SYNOPSIS
combine_tessdata [OPTION] FILE... DESCRIPTION
combine_tessdata(1) is the main program to combine/extract/overwrite tessdata components in [lang].traineddata files. To combine all the individual tessdata components (unicharset, DAWGs, classifier templates, ambiguities, language configs) located at, say, /home/$USER/temp/eng.* run: combine_tessdata /home/$USER/temp/eng. The result will be a combined tessdata file /home/$USER/temp/eng.traineddata Specify option -e if you would like to extract individual components from a combined traineddata file. For example, to extract language config file and the unicharset from tessdata/eng.traineddata run: combine_tessdata -e tessdata/eng.traineddata /home/$USER/temp/eng.config /home/$USER/temp/eng.unicharset The desired config file and unicharset will be written to /home/$USER/temp/eng.config /home/$USER/temp/eng.unicharset Specify option -o to overwrite individual components of the given [lang].traineddata file. For example, to overwrite language config and unichar ambiguities files in tessdata/eng.traineddata use: combine_tessdata -o tessdata/eng.traineddata /home/$USER/temp/eng.config /home/$USER/temp/eng.unicharambigs As a result, tessdata/eng.traineddata will contain the new language config and unichar ambigs, plus all the original DAWGs, classifier templates, etc. Note: the file names of the files to extract to and to overwrite from should have the appropriate file suffixes (extensions) indicating their tessdata component type (.unicharset for the unicharset, .unicharambigs for unichar ambigs, etc). See k*FileSuffix variable in ccutil/tessdatamanager.h. Specify option -u to unpack all the components to the specified path: combine_tessdata -u tessdata/eng.traineddata /home/$USER/temp/eng. This will create /home/$USER/temp/eng.* files with individual tessdata components from tessdata/eng.traineddata. OPTIONS
-e .traineddata FILE...: Extracts the specified components from the .traineddata file -o .traineddata FILE...: Overwrites the specified components of the .traineddata file with those provided on the comand line. -u .traineddata PATHPREFIX Unpacks the .traineddata using the provided prefix. CAVEATS
Prefix refers to the full file prefix, including period (.) COMPONENTS
The components in a Tesseract lang.traineddata file as of Tesseract 3.02 are briefly described below; For more information on many of these files, see http://code.google.com/p/tesseract-ocr/wiki/TrainingTesseract3 lang.config (Optional) Language-specific overrides to default config variables. lang.unicharset (Required) The list of symbols that Tesseract recognizes, with properties. See unicharset(5). lang.unicharambigs (Optional) This file contains information on pairs of recognized symbols which are often confused. For example, rn and m. lang.inttemp (Required) Character shape templates for each unichar. Produced by mftraining(1). lang.pffmtable (Required) The number of features expected for each unichar. Produced by mftraining(1) from .tr files. lang.normproto (Required) Character normalization prototypes generated by cntraining(1) from .tr files. lang.punc-dawg (Optional) A dawg made from punctuation patterns found around words. The "word" part is replaced by a single space. lang.word-dawg (Optional) A dawg made from dictionary words from the language. lang.number-dawg (Optional) A dawg made from tokens which originally contained digits. Each digit is replaced by a space character. lang.freq-dawg (Optional) A dawg made from the most frequent words which would have gone into word-dawg. lang.fixed-length-dawgs (Optional) Several dawgs of different fixed lengths -- useful for languages like Chinese. lang.cube-unicharset (Optional) A unicharset for cube, if cube was trained on a different set of symbols. lang.cube-word-dawg (Optional) A word dawg for cube's alternate unicharset. Not needed if Cube was trained with Tesseract's unicharset. lang.shapetable (Optional) When present, a shapetable is an extra layer between the character classifier and the word recognizer that allows the character classifier to return a collection of unichar ids and fonts instead of a single unichar-id and font. lang.bigram-dawg (Optional) A dawg of word bigrams where the words are separated by a space and each digit is replaced by a ?. lang.unambig-dawg (Optional) TODO: Describe. lang.params-training-model (Optional) TODO: Describe. HISTORY
combine_tessdata(1) first appeared in version 3.00 of Tesseract SEE ALSO
tesseract(1), wordlist2dawg(1), cntraining(1), mftraining(1), unicharset(5), unicharambigs(5) COPYING
Copyright (C) 2009, Google Inc. Licensed under the Apache License, Version 2.0 AUTHOR
The Tesseract OCR engine was written by Ray Smith and his research groups at Hewlett Packard (1985-1995) and Google (2006-present). 02/09/2012 COMBINE_TESSDATA(1)
All times are GMT -4. The time now is 01:41 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy