All Questions
18 questions
-2
votes
1
answer
251
views
modify the columns
This is my dataset:
chr1_KI270706v1_random,153401,rs867658023,chr1_KI270706v1_random_153401
chr1_KI270706v1_random,154751,rs1030747857,chr1_KI270706v1_random_154751
chr1_KI270706v1_random,156703,...
0
votes
3
answers
56
views
Exclude line from output file if charaters in columns 9-14 aren't found in another file
I have two column delimited files and I need to create two new files of only the records where the transaction identifiers were found in both files. The identifier is in a field spanning from columns ...
0
votes
0
answers
843
views
display grid of data in bash
would like to get an opinion on how best to do this in bash, thank you
for x number of servers, each has it's own list of replication agreements and their status.. it's easy to run a few commands and ...
1
vote
2
answers
1k
views
How to join columns from two files using awk/sed command?
I have two files File-1 and File-2 with data in columns. I want to create another file and copy the data of the first column of File-2 corresponding to the data to file-1 in row wise as given below.
...
0
votes
6
answers
2k
views
I have a table and I want to extract the row in reverse order of columns in shell script [closed]
The table looks like this:
1|Hunk|First|London
2|Hero|Second|London
3|Will|First|Pow
4|Thomas|Second|Pow
5|Venus|First|Berlin
I want to print the output as:
Berlin|First|venus|5
i want to print only ...
49
votes
4
answers
73k
views
Bash shell script output alignment
My script:
date
echo -e "${YELLOW}Network check${NC}\n\n"
while read hostname
do
ping -c 1 "$hostname" > /dev/null 2>&1 &&
echo -e "Network $hostname : ${GREEN}Online${NC}" ||
...
3
votes
1
answer
1k
views
Copy a block of text to a specific point in another file
I'm trying to figure out how to move a block of text from one file to a specific point in another. I have a large amount of files that looks like this:
H -9.92247800 1.33807800 -...
0
votes
1
answer
116
views
Table transformation
Looks like I hit a block with something I reckon must be quite simple.
I have a ranking table 1: (file 1)
Ranking ID
1 A
2 B
5 C
6 D
12 n
file 2:
A
A
A
B
B
...
1
vote
1
answer
97
views
Build a matrix based on the values of another matrix
Today I found a an interesting question about shell scripting in other site. The question was build a matrix based on the values of another matrix
https://askubuntu.com/questions/884372/count-number-...
0
votes
2
answers
57k
views
generate a csv file
I have a script that generates a .txt file.
That file have tab-delimited columns.
The number of columns vary depending on the input file.
How can I convert that .txt file to csv format? I want to ...
1
vote
3
answers
1k
views
Reduce length of specific column in delimited text file
I need for the 5th column in a delimited text file to be reduced to just the first 5 characters. All other columns must remain unedited.
Input:
file1.txt column1 column2 column3 ...
3
votes
2
answers
2k
views
Compare 2 delimited files and output differences
I have asked similar questions here a couple times in the past with great success, but now my needs have slightly changed and I am struggling to get the exact output I am looking for.
I would like to ...
4
votes
2
answers
2k
views
Compare 2 tab delimited files and output differences with column header
I would like to compare 2 similar files on a common column. The files will have identical headers.
file1.txt
mem_id Date Time Building
aa bb cc dd
ee ff ...
2
votes
2
answers
97
views
How to add a new line for a missing entry between two fields
I have this file. As you can see in column1, entries TEST01N03, TEST01N06,
and TEST01N18 are missing (total of 18 entries).
Is there a way to check the fields of this column and fill in the missing
...
5
votes
2
answers
192
views
Replace common values in two files according to first column
How do I replace common values in two files according to first column?
I have file 1 (1.txt):
CH063_01084
CH063_01083
CH063_13925
CH063_14473
and file 2 (2.txt):
CH063_01083 FGSG_16349 4
...