Assign sets of values from each row of a table separately to a command in bash

hola

I have a txt file (input.txt) with 3 columns separated by \t.

62M__29_length_73210_cov_19.6684    28981-31993    minus
61M__32_length_66572_cov_22.1672    22311-25323    minus
60M__65_length_73281_cov_15.6315    28978-31990    minus
59M__78_length_80030_cov_19.1814    28973-31985    minus
58M__28_length_80029_cov_24.2362    28972-31984    minus
57M__31_length_73253_cov_24.4297    41300-44312    plus
56M__32_length_73450_cov_26.6071    28975-31987    minus
55M__29_length_73232_cov_26.5615    41244-44256    plus
54M__38_length_66570_cov_23.8255    41307-44319    plus

I need to run a command using the values from each row in this way:

blastdbcmd -db mydatabase -entry "row_1_column_1" -range "row_1_column_2" -strand "row_1_column_3" -out out.fa

For example, for row 1 it would be:

blastdbcmd -db mydatabase -entry 62M__29_length_73210_cov_19.6684 -range 28981-31993 -strand minus -out out.fa
Freddy

With bash:

while IFS=$'\t' read -r entry range strand; do
  blastdbcmd -db mydatabase -entry "$entry" -range "$range" -strand "$strand" -out out.fa
done <input.txt

Read the input file linewise and split each line into three variables separated by a tab. Then run the command using these variables.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

BASH script: How to assign each line of command output to values in an array?

From Dev

recursively loop information from each row of a file through a command [bash]

From Dev

Bash function: Execute $@ command with each argument in sequence executed separately

From Dev

php count and add each values from MySQL table row

From Dev

Apply a function separately to each row

From Dev

Assign element from array to each table cell

From Dev

Sorting of 2 different sets of values of single row of a table

From Dev

Assign a unique count to each row in the resulting table of a select statement

From Dev

Select row from table from each schema

From Dev

Select row from table from each schema

From Dev

R - Randomize each row in a matrix separately

From Dev

changing css of controls in gridview separately for each row

From Dev

How to run a query for each row from a table?

From Dev

Select highest revision from table for each row

From Dev

adding each row value from different table

From Dev

R Vectorize: Assign values to each row, diff col based on col index for every row

From Dev

Get and display all values from database row separately based on select (Rails)

From Dev

Count Values from Table for each type

From Dev

Execute table valued function from row values

From Dev

extracting row values from a single table with a condition

From Dev

extracting row values from a single table with a condition

From Dev

Get values from between two other values for each row in the dataframe

From Dev

Objective-C: Get text field values of each table row

From Dev

List columns with NA values for each row of a data.table in R

From Dev

How to count unique values for each row in a table in R?

From Dev

Getting values of each textbox with the same class inside the table row

From Dev

Getting values of each row of a html table and storing in a variable to be used later

From Dev

Insert row in table for each id from another table

From Dev

selecting records from main table and count of each row in another table

Related Related

  1. 1

    BASH script: How to assign each line of command output to values in an array?

  2. 2

    recursively loop information from each row of a file through a command [bash]

  3. 3

    Bash function: Execute $@ command with each argument in sequence executed separately

  4. 4

    php count and add each values from MySQL table row

  5. 5

    Apply a function separately to each row

  6. 6

    Assign element from array to each table cell

  7. 7

    Sorting of 2 different sets of values of single row of a table

  8. 8

    Assign a unique count to each row in the resulting table of a select statement

  9. 9

    Select row from table from each schema

  10. 10

    Select row from table from each schema

  11. 11

    R - Randomize each row in a matrix separately

  12. 12

    changing css of controls in gridview separately for each row

  13. 13

    How to run a query for each row from a table?

  14. 14

    Select highest revision from table for each row

  15. 15

    adding each row value from different table

  16. 16

    R Vectorize: Assign values to each row, diff col based on col index for every row

  17. 17

    Get and display all values from database row separately based on select (Rails)

  18. 18

    Count Values from Table for each type

  19. 19

    Execute table valued function from row values

  20. 20

    extracting row values from a single table with a condition

  21. 21

    extracting row values from a single table with a condition

  22. 22

    Get values from between two other values for each row in the dataframe

  23. 23

    Objective-C: Get text field values of each table row

  24. 24

    List columns with NA values for each row of a data.table in R

  25. 25

    How to count unique values for each row in a table in R?

  26. 26

    Getting values of each textbox with the same class inside the table row

  27. 27

    Getting values of each row of a html table and storing in a variable to be used later

  28. 28

    Insert row in table for each id from another table

  29. 29

    selecting records from main table and count of each row in another table

HotTag

Archive