Questions tagged [table]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
54 views

Merge rows using common values in any column

I have a tab-delimited file like shown below, and would like to merge the rows based on matches in any of the columns. The number of columns are usually 2, but could vary in some cases and be 3. ...
-2
votes
2answers
40 views

Text to table with v lookup [closed]

I have file as below FileName:File1.txt Can we get the format as below table
-1
votes
2answers
71 views

BASH: AWK pivot CSV into desired table

I have been struggling with pivoting .csv file into desired table format using bash. My file o/p: $ cat finalcount.csv state,status,count NW,CONGESTED,11 NW,CLEARED,9 ACT,CLEARED,7 ACT,CONGESTED,7 ...
0
votes
0answers
15 views

Manually edit a sfdisk table

I have this table # partition table of /dev/sda unit: sectors /dev/sda1 : start= 2048, size= 716800, Id= 7, bootable /dev/sda2 : start= 718848, size=419430400, Id= 7 /dev/sda3 : start=...
-2
votes
1answer
18 views

Is it possible to sort out similar rows in a table and put the number in a column? [duplicate]

I have this table gene 5 5 5 gene 4 4 3 gene 5 5 5 gene 1 4 5 and I would like to have the following, gene 5 5 5 2 gene 4 4 3 1 gene 1 4 5 1 so in the last column ...
0
votes
1answer
26 views

Merging two .csv tables one with header other - not

I need to merge two .csv tables, one that contains the following info with NO HEADER: gene0 ABCD gene1 xyz gene2 1234 ..etc Another table has a header and information like that: gene_id ...
-2
votes
1answer
93 views

How can I scramble a text file table, with a table

I have a table. The column order must not be changed. And the values should be kept. Name Age size Code Abel 10 S A Bjorn 20 M B Casimir 30 L C Dennis 40 XL D I don't just ...
0
votes
3answers
81 views

How to calculate the sum of bytes in a column?

I have this table below, how can I calculate the sum of bytes for records in Nov only? for example below I want to find rows in Nov then sum the numbers in column4 relevant to Nov only? how I can do ...
1
vote
1answer
542 views

Awk for merging multiple files with common column

I have a question concerning awk command in unix to merge multiple tables with a common value Tab1 Geneid Chr Start End Strand Length Sample_1 ENSG00000278267 1 17369 17436 - 68 0 ...
2
votes
1answer
192 views

Manually set NX bit of specific PTE

On Ubuntu with kernel 4.16.7 I am writing a custom system call and, I want to set the NX bit of a specific Page Table Entry. So far I have this piece of code, where I am doing a page table walk to get ...
0
votes
1answer
43 views

How to add a text file content to the next column of an existing table

How do a add a new line to an existing .txt file, that consists of a text string, a tab, and a value of another text file? Precisely, I have a text file test1.txt that looks like this: A B and a ...
1
vote
0answers
590 views

Referencing dynamically created table names in Create statement written in shell script

I need to write a script to automatically generate a month end report. The generation process involved creating tables in database and then accessing them later in the same script to create another ...
1
vote
1answer
560 views

Why some tables contains only part of chains in iptables?

I am reading some tutorial on the webpage iptables tutorial. There are five chains in iptables. PREROUTING chain OUTPUT chain FORWARD chain INPUT chain POSTROUTING chain And there are four tables in ...
0
votes
2answers
89 views

Changing from row to column with Shell script command

I'm using UNIX language to extract my files. I used this command to extract it: value_1=$(cat tmp.csv | head -1001 | cut -f 3-6 -d','> tmp1.csv) value_2=$(cat tmp.csv | head -2002 | tail -1001 | ...
2
votes
4answers
95 views

Extracting lines appeared consecutively for 3 times or more in Linux

I have a table in Linux : A 0 A 0 A 0 B 0 B 1 B 0 B 1 B 0 I want to extract lines appeared consecutively for 3 times or more. My expected output is : A 0 Actually, 3 times or more is just a ...
2
votes
1answer
3k views

printing row-based data in a table format on Linux

I have the below data in a file: col1 col2 col3 subcol1 subcol2 subcol3 subcol4 subcol5 subcol6 col4 subcol7 subcol8 subcol9 subcol10 subcol11 subcol2 The ...
1
vote
2answers
111 views

Extracting quoted and labelled data from a given column

I have a large GTF file, like below: # ./stringtie -p 4 -G /home/humangenome_hg19/homo_gtf_file.gtf -o strAD1_as/transcripts.gtf -l strAD1 /home/software/star-2.5.2b/bin/Linux_x86_64/mapA1Aligned....
0
votes
1answer
81 views

Edit value in table

Need to set a function which receives a username, location in the table and the new value to set. the table set is user:value1:value2:value3 I realize how I can do the replace using awk '{gsub... ...
2
votes
3answers
8k views

Bash output array in table

I'm quite new at bash and I am trying to learn it by creating some small scripts. I created a small script to look up the DNS entry for multiple domains at the same time. The domains are given as ...
3
votes
3answers
757 views

Delete columns that sum to zero

I have a numeric table, that is all cells have numbers. It is a tab-delimited file, with non-numeric headers and row names. I need to delete all columns that add up zero. I would like to keep the ...
1
vote
1answer
1k views

Adding column to a table by concatenating values from other columns

I have several csv table as follow: YEAR;MONTH;DAY;RES1;RES2 1971;1;1;1206.1;627 1971;1;2;1303.4;654.3 1971;1;3;1248.9;662 1971;1;4;1188.8;666.8 From this I would like to create a new column that ...
0
votes
1answer
243 views

Calculate average values for each day over multiple years

I have some "CSV" data (actually using ; as a delimiter) having a row for every day from 1971-01-01 through 2099-12-31 (a span of 2099−1971=128 years). The data are organized as follows: YEAR;MONTH;...
1
vote
2answers
3k views

Change header using sed or awk

I have different file for which I would like to change the header. Currently the tables are as follow: MONTH GFDL.ESM2M_ECOMAG GFDL.ESM2M_HYPE 1 3546.21855483871 2345.11127781945 I would like to ...
1
vote
1answer
470 views

Paste different csv files

I have a bunch of input csv files (delimited with semi-colon ";" having the following format YEAR;MONTH;DAY;RES1FILE1;RES2FILE1;RES3FILE1 1901;01;01;101;154;169 1901;01;02;146;174;136 The number of ...
1
vote
1answer
82 views

space in time column causing problem in formatting html file in script

I am in the process of creating an automated mail where in the body of the mail data should be displayed in a table format. I did some extent generate a table format in the body of mail, but I am ...
0
votes
1answer
74 views

reformat values in a table

I have some tables, in which I need to replace several values. I have different commands sed and tr that work just fine when I apply them to a single file. But somehow, when I want to build a loop ...
0
votes
1answer
343 views

Replace value in a table

I have some tables for which I need to replace a field that has a random position in each table. For information, the table are semicolon separated fields and I would like to replace the field "datum"...
0
votes
1answer
67 views

Table - Replace values of a column

I have several tables (tab separated) in which the first column is as follow: MONTH 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 I would like to replace those values by the actual ...
0
votes
3answers
47 views

Reformat table - Number of digits

I have some tables were the numbers have too much digits; as follow: MONTH A1 A2 A3 ...... 1 1.54564468 2.48949 6.4984984 ..... Is there a way, using unix, to reformat the table in the following ...
0
votes
3answers
1k views

How can I use a triple slash as a delimiter with cut?

I have a table in which each entry looks something like, coagulation factor VIII-associated 1 /// coagulation factor VIII-associated 2 /// coagulation factor VIII-associated 3 I would like to use ...
7
votes
2answers
2k views

Issue with column command and color escape codes

I'm colorizing the header of a table formatted with column -ts $'\t' Works well without color codes, but when I add color codes to the first line column doesn't properly align the output. Without ...
1
vote
1answer
490 views

Matching 2 main columns between files; and paste other columns into the output file when those main columns match. Keep row size of 1st file intact

This is a follow-up question to my previous question asked about 24 hours ago. Link to previous question: Previous Question Link G-Man solved that problem with a useful code, but I have a follow-up ...
1
vote
1answer
92 views

Replace values in a table

I have a table (ascii format with space delimiter), as follow: 1 1 1900 111 1 2 1900 121 1 3 1900 145 1 4 1900 1.45e 07 1 5 1900 5.21e 25 1 6 1900 152 I would like, that if there is a fifth column (...
2
votes
4answers
121 views

Move files/table following selection criteria

Considering a variable a describing temperature series for the city a. I have 9 directories (a1, a2, a3, a4, a5, a6, a7, a8, a9) each of them containing a table (respectively a1.txt, a2.txt, a3.txt, ...
1
vote
1answer
871 views

Text extraction from HTML page

I am using xidel command to extract text from HTML page. Here is my code xidel http://www.ip-adress.com/ip_tracer/8.8.8.8 --extract "<table> <tbody> <tr> <td> <...
1
vote
0answers
581 views

extracting text from HTML

I have this page. I want to extract text from html page, particularly table heading (th) and table data (td). For example: Country: United States (US),State: California where th = Country and td = ...
4
votes
3answers
715 views

Leap year - extrapolating value

I have some tables (table.txt) as follow: YEAR MONTH DAY RES 1971 1 1 1345 1971 1 2 1265 1971 1 3 1167 The length of each time series goes from 1.1.1971 until 31.12.2099. ...
3
votes
3answers
143 views

Reformat tables

I have some tables (table.txt) that have been wrongly built and present redundancey in the results, as follow: YEAR MONTH DAY RES 1971 1 1 245 1971 1 2 587 ... 1971 12 31 685 1971 1 ...
3
votes
4answers
776 views

Convert floating point numbers to decimal numbers

I have several 'ascii' tables in a directory, some of them have numbers expressed in decimal and some others ones in floating point, as follow: 1 1 1423 1 2 1589 1 3 0.85e 5 1 4 0.89e 4 1 5 8796 ... ...
0
votes
1answer
132 views

Merging and appending tables to create a master table of multiple tables

How to we can merge and append the multiple tables in the same format having same as well as different data point and merge all of the together by inputting zero to the null data points. Desired input ...
0
votes
0answers
1k views

Where is the route table file in SUSE?

According to the documentation at http://www.softpanorama.org/Net/Linux_networking/Suse_networking/suse_etc_sysconfig_network_route.shtml there should be a table containing the routes at /etc/...
1
vote
2answers
270 views

Alignment when printing a series of records

How can I resolve the problem of the tables going to the right. I just want it to be shown under 1. Here's my script with START added. The alignment has gone wonky now: while IFS="," read f1 f2 f3 ...
1
vote
1answer
973 views

Routing table and multiply hops

I have 6 networks, I need to connect network 1 and network 5 via five routers. What’s the command to set multiply hops? ip route add IP_address/mask via IP_adrress dev eth0, but how do I set next hop? ...
1
vote
0answers
985 views

Overlapping Partition table

I'm so done with this, i have this 64GB sd card and i just don't know any more. when i format it the data and partition tables just stay there. :'( all i want is for a blank drive, i've got a backup ...
20
votes
2answers
24k views

which order is the route table analyzed in?

On my pc I have to following routing table: Destination Gateway Genmask Flags MSS Window irtt Iface 0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 ...
-2
votes
2answers
59 views

extract line from same string

I have a table like this: and a file containing 2 string from the third column as: apple potato i would like to extract the header and all the line that contain the string apple and potato to obtain ...
0
votes
0answers
2k views

Disk /dev/sda doesn't contain partition table

I am unable to booting with my laptop getting this error No operating system after booing with Live cd if i give this command fidsk -l getting below error. mint@mint ~ $ sudo fdisk -l Disk /dev/...
2
votes
2answers
11k views

Sorting a CSV file, but not it's header [duplicate]

I need to sort a CSV file, but the the header row (1st row) keeps getting sorted. This is what I'm using: cat data1.csv | sort -t"|" -k 1 -o data1.csv Here's a sample line: Name|Email|Country|...
0
votes
1answer
81 views

Macbook System Profiler formatted

I want to format the output generated from macbook terminal command system_profiler and transpose the row values to columns under the same Application. Here's a snippet of the file: Firefox: ...
2
votes
0answers
560 views

How to paste an HTML table into Libre Office Calc without losing structure

I want to paste an HTML table into Libre Office Calc. The HTML table rows contain images (in column 1) that should stay with their appropriate row. However, when I paste my HTML into Calc, the images ...