awk

How to read from file and output to html table with AWK

有些话、适合烂在心里 提交于 2021-02-11 15:47:37
问题 I'm newby in AWK and I know its not a specific question. I just need some advice how should i do this. Given the following names in a file, author.list: KOVACS PETER Kiss Roland Nagy jolan Lisztes Tibor Feher aNDRas Korma Maria Akarki Jack write an AWK program that can read the names from the file and print them to an html table with a three-column format in an output file, output.html. The table should render like this: Kovacs Peter Lisztes Tibor Akarki Jack Kiss Roland Feher Andras Nagy

How to read from file and output to html table with AWK

会有一股神秘感。 提交于 2021-02-11 15:47:24
问题 I'm newby in AWK and I know its not a specific question. I just need some advice how should i do this. Given the following names in a file, author.list: KOVACS PETER Kiss Roland Nagy jolan Lisztes Tibor Feher aNDRas Korma Maria Akarki Jack write an AWK program that can read the names from the file and print them to an html table with a three-column format in an output file, output.html. The table should render like this: Kovacs Peter Lisztes Tibor Akarki Jack Kiss Roland Feher Andras Nagy

Intersecting text files by its location from a list

我只是一个虾纸丫 提交于 2021-02-11 15:19:54
问题 I need to intersect the a file from a list of locations as like this File 1 cat02 2 5 cat02 2 3 cat03 2 3 File2 cat02 1 xxx xxx cat02 2 xxx sss www cat02 3 swe ede rrr cat02 4 aqw ede efd cat02 5 aws ede as cat02 6 aqw cat03 1 aaa cat03 2 wer cat03 3 ddddd expected output cat02 2 xxx sss www cat02 3 swe ede rrr cat02 4 aqw ede efd cat02 5 aws ede as cat02 2 xxx sss www cat02 3 swe ede rrr cat03 2 wer cat03 3 ddddd For this purpose I used this code awk 'FNR==NR{ start[$1]=$2 till[$1]=$3 next}

How can find similarity between sentences? [closed]

依然范特西╮ 提交于 2021-02-11 14:54:40
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed last month . Improve this question I'm trying to find similarities between both the sentences in a shell script. Have a two sentences containing duplicate words, for example, the input data in file my_text.txt Shell Script. Linux Shell Script. The intersection of both sentences: Shell + Script The union " size "

awk bash avg calculation in file

夙愿已清 提交于 2021-02-11 14:41:49
问题 write the unix command to display roll, name and avg of all students whose score is more than 50 in each subject and average is more than or equal to 75. avg can be calculated as (subj_1+subj_2)/2. input: roll ,name,subScore1,subScore2 123,a,88,78 101,b,76,90 812,c,78,98 output: 123 a 83 812 c 78 my code: awk 'BEGIN {FS=',';OFS=' '} {if(NR>1 (&& $3>50 && $4>50) && ($3+$4)/2 >= 75){print $1,$2,($3+$4)/2}}' input_file I don't know why I'm getting error. please help guys. 回答1: EDIT: Adding more

awk find missing number in sequence from file1 and append to column in file2

被刻印的时光 ゝ 提交于 2021-02-11 13:47:04
问题 hi as suggested in previous question, i will try more clarify what i want to achieve. as in file1, in column $4 i have numbers which are not continuosly sequenced like 1,2,3,4,5.. , it means i need print those missing ones e.g. after number 3 i should get number 4 and so on cat file1 A R5 A48 1 B R5 A48 2 C R4 A48 3 D R8 A48 15 E R9 A48 22 F R20 B55 21 G R55 B22 19 R B1 I77 14 AA B8 PP 18 BX A255 PA 7 CA A77 PB 10 WW W7 PX 11 i find out partly solution in this awk one liner returning arr=($

awk find missing number in sequence from file1 and append to column in file2

偶尔善良 提交于 2021-02-11 13:45:21
问题 hi as suggested in previous question, i will try more clarify what i want to achieve. as in file1, in column $4 i have numbers which are not continuosly sequenced like 1,2,3,4,5.. , it means i need print those missing ones e.g. after number 3 i should get number 4 and so on cat file1 A R5 A48 1 B R5 A48 2 C R4 A48 3 D R8 A48 15 E R9 A48 22 F R20 B55 21 G R55 B22 19 R B1 I77 14 AA B8 PP 18 BX A255 PA 7 CA A77 PB 10 WW W7 PX 11 i find out partly solution in this awk one liner returning arr=($

Converting a GenBank-like multiline record into a new file format (fasta format)

☆樱花仙子☆ 提交于 2021-02-11 12:55:51
问题 I have a file with the following architecture: source 1..3566367 /organism="Laccaria bicolor S238N-H82" /mol_type="genomic DNA" /strain="S238N-H82" /db_xref="taxon:486041" gene <143..>783 /locus_tag="LACBIDRAFT_300552" /db_xref="GeneID:6069681" mRNA join(<143..224,274..309,357..470,524..>783) /locus_tag="LACBIDRAFT_300552" /product="helix-turn-helix transcription factor, AraC type" /note="Has EST support" /transcript_id="XM_001873113.1" /db_xref="GeneID:6069681" CDS join(143..224,274..309,357

Bash Script changing the output file for every file

Deadly 提交于 2021-02-11 12:40:19
问题 I'm trying to use a command on everyfile .log in a folder but I can't understand how to change the output file for every file in the folder. #!/bin/bash N="0" for i in "*.log" do echo "Processing $f file..." cat $i | grep "test" | awk '/show/ {a = $1} !/show/{print a,$6}' > "log$N.txt" done How can i increment the counter for log$n.txt? 回答1: It's bad practice to write shell loops just to process text (see https://unix.stackexchange.com/questions/169716/why-is-using-a-shell-loop-to-process

Bash Script changing the output file for every file

给你一囗甜甜゛ 提交于 2021-02-11 12:39:15
问题 I'm trying to use a command on everyfile .log in a folder but I can't understand how to change the output file for every file in the folder. #!/bin/bash N="0" for i in "*.log" do echo "Processing $f file..." cat $i | grep "test" | awk '/show/ {a = $1} !/show/{print a,$6}' > "log$N.txt" done How can i increment the counter for log$n.txt? 回答1: It's bad practice to write shell loops just to process text (see https://unix.stackexchange.com/questions/169716/why-is-using-a-shell-loop-to-process