Timeline for splitting a line into array in bash with tab as delimiter
Current License: CC BY-SA 3.0
17 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jan 17, 2021 at 8:42 | comment | added | giorgio79 | dupe of stackoverflow.com/questions/9736202/… | |
| Dec 13, 2017 at 19:11 | comment | added | user3138373 | @terdon : I posted it on the bioinformatics site as a different question where I don't want to use shell for text parsing. Have a look and share your thoughts. Thanks again | |
| S Dec 13, 2017 at 18:58 | history | suggested | Jake Symons | CC BY-SA 3.0 |
Removed noise
|
| Dec 13, 2017 at 18:55 | review | Suggested edits | |||
| S Dec 13, 2017 at 18:58 | |||||
| Dec 13, 2017 at 18:38 | comment | added | terdon♦ | Please don't, no. Don't post identical questions on different Stack Exchange sites, that is called "cross-posting" and is against the rules. Either delete the question from one site and post on the other or adapt the question to fit the target site better. Posting a similar, but different, question is fine. | |
| Dec 13, 2017 at 18:35 | comment | added | user3138373 | @terdon: Can I post this same question on the Bioinformatics site so that I can get some more clarifications from you or the community? | |
| Dec 13, 2017 at 18:31 | comment | added | terdon♦ |
Sure, awk, cut, perl, anything but the shell is better. For instance, in awk, all you would need is awk -F "\t" '{print $6, $7}' to get the 6th and 7th columns. By the way, it looks like you might be interested in our new Bioinformatics site. Come on over!
|
|
| Dec 13, 2017 at 18:29 | comment | added | user3138373 | @terdon: I actually have another column which is a URL. I want to use wget command on the URL and use the -O option to change the file name. I have been having issues where space and tab cause problems to me. So should I use awk for processing here?? Thanks for all your help | |
| Dec 13, 2017 at 18:23 | comment | added | RomanPerekhrest | @ilkkachu, read the entire question: the title is "splitting a line into array in bash with tab as delimiter" , the description says: "say 6th column which is 8 week in a variable" | |
| Dec 13, 2017 at 18:22 | comment | added | terdon♦ | As a general rule, you really don't want to use the shell for text parsing. It is very hard to do correctly (as you're finding out) and will be very slow. Have a look at Why is using a shell loop to process text considered bad practice? for more details and How can I extract/change lines in a text file whose data are separated into fields? for other options. | |
| Dec 13, 2017 at 18:21 | comment | added | ilkkachu | I can't see what the contradiction is? They want to split the line, pick one of the fields and put it in a variable. | |
| Dec 13, 2017 at 18:20 | vote | accept | user3138373 | ||
| Dec 13, 2017 at 18:16 | comment | added | RomanPerekhrest | then, your title contradicts with your description. Update your question | |
| Dec 13, 2017 at 18:15 | comment | added | user3138373 | the 6th field is 8 week. I want to save that in a variable | |
| Dec 13, 2017 at 18:15 | answer | added | ilkkachu | timeline score: 18 | |
| Dec 13, 2017 at 18:14 | comment | added | RomanPerekhrest | I suppose that you want to save each 6th field value into an array, not a variable, right? | |
| Dec 13, 2017 at 18:02 | history | asked | user3138373 | CC BY-SA 3.0 |