I am currently working on a script that would be rearranging the contents of a csv file. if I had a line that was similar to this:
stack,over,flow,dot,com
how could I go about determining the location of a string/word in the command delimited string. So for instance if I were to search for stack, it would return the number 1, if i were to search for flow, the number 3 would be returned, and so on. I've thought of a few ways in which I could do this, but they are mostly long drawn out scripts, so I have the feeling that there may be a shorter/simpler way to do this. If anyone could offer advice/help I would really appreciate it, thanks. also this is being performed in bash environment