searching a text file
i have a text file and i want to search for lines with 8, 9, and 2 in the second column.
778560717,1,0.000000 778560717,2,0.000000 778560717,3,0.000000 778560717,4,0.000000 778560717,5,0.000000 778560717,6,0.000000 778560717,7,0.000000 778560717,8,0.000000 778560717,9,0.000000 778560717,31,0.000000 778560717,32,250.000000 778560717,39,0.000000 |
Hi,
in the general case, awk might be more useful, but in this case you can use grep and exploit the fact that only the 2nd column has a ',' on either side. Code:
grep -E ',[8|9|2],' filename Evo2. |
What have you tried so far? The grep, sed, and awk commands are all capable of handling something like this.
EDIT: Well, since the cat is out of the bag... :) Code:
sed -n '/[^,]*,[289],/p' datafile.txt |
All times are GMT -5. The time now is 06:39 PM. |