tab-delimited-text

Batch processing tab-delimited files in XSLT

落花浮王杯 提交于 2020-01-04 06:35:26
问题 I have an XML file with a list of 92 tab-delimited text files: <?xml version="1.0" encoding="UTF-8"?> <dumpSet> <dump filename="file_one.txt"/> <dump filename="file_two.txt"/> <dump filename="file_three.txt"/> ... </dumpSet> The first row in each file contains the field names for the subsequent rows. This is just an example. The names and number of elements will vary by record. Most will have around 50 field names. Title Translated Title Watch Video Interviewee Interviewer Interview with

Batch processing tab-delimited files in XSLT

大兔子大兔子 提交于 2020-01-04 06:34:12
问题 I have an XML file with a list of 92 tab-delimited text files: <?xml version="1.0" encoding="UTF-8"?> <dumpSet> <dump filename="file_one.txt"/> <dump filename="file_two.txt"/> <dump filename="file_three.txt"/> ... </dumpSet> The first row in each file contains the field names for the subsequent rows. This is just an example. The names and number of elements will vary by record. Most will have around 50 field names. Title Translated Title Watch Video Interviewee Interviewer Interview with

AWK work wit vcf (text) file

青春壹個敷衍的年華 提交于 2019-12-25 04:53:38
问题 I would like to create awk code, which will modifie text like this: Tab delimited all columns Delete all columns which is starting by "##text" And keep headers, which starts "#header" I have this code, but it is not good: #!/bin/bash for i in *.vcf; do awk 'BEGIN {print "CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILT\tINFO\tFORMAT"}' | awk '{$1 "\t" $2 "\t" $3 "\t" $4 "\t" $5 "\t" $6 "\t" $7 "\t" $8 "\t" $9}' $i | awk '!/#/' > ${i%.vcf}.tsv; done INPUT: > ##fileformat=VCFv4.1 > ##FORMAT=<ID=GQX,Number

Python vertical txt concatenation not working properly

╄→гoц情女王★ 提交于 2019-12-25 03:41:47
问题 There are two solutions from Concatenate tab-delimited txt files vertically Suppose input1 is X\tY input2 is A\tB\r\n C\t\r\n Here, A, B, C are ordinary words and \t is tab. If I run filenames = [input1, input2] with open(output, 'w') as outfile: for fname in filenames: with open(fname) as infile: outfile.write(infile.read().rstrip() + '\n') then I get X\tY\r\n A\tB\r\n C Suddenly \t after C disappears. If I run filenames = [input1, input2] with open(output, 'w') as outfile: for fname in

Python to remove duplicates using only some, not all, columns

吃可爱长大的小学妹 提交于 2019-12-25 02:32:29
问题 I have a tab-delimited input.txt file like this A B C A B D E F G E F T E F K These are tab-delimited. I want to remove duplicates only when multiple rows have the same 1st and 2nd columns. So, even though 1st and 2nd rows are different in 3rd column, they have the same 1st and 2nd columns, so I want to remove "A B D" that appears later. So output.txt will be like this. A B C E F G If I was to remove duplicates in usual way, I just make the lists into "set" function, and I am all set. But now

Tab Delimited Text Copy Paste To Excel

本秂侑毒 提交于 2019-12-24 01:47:58
问题 I am generating a block of text via C# Stringbuilder, with appropriately tab-delimited text (new lines, "\t", etc.) and displaying the text within a tag in my web application. If I copy/paste this to Excel, all the text pastes into the first column on the spreadsheet. If I copy the outerHTML of the block (Chrome) or copy/paste into Notepad++ and THEN paste to Excel, all the data pastes neatly into individual cells - which is the desired outcome of this effort. Can anyone tell me what I need