I have the following comma-delimited data (spaces used for visual clarity): 1 2014 23 2352 19.24 7.18 1 2014 23 2353 19.78 4.6524 2014 23 2354 20.26 25.34 1 2014 23 2355 26.65 42.76 1 2014 23 2356 27.34 56.356 1 2014 23 2357 29.24 45.424 2014 23 2358 30.23 345.27 1 2014 23 2359 23.23 345.21 1 2014 24 0000 12.53 1.98 1 2014 24 0001 7.24  12.324 2014 24 0002 15.68 90.8I would like to remove only every line that starts with 24 (or keep every line that starts with 1, either way). So the desired output would be: 1 2014 23 2352 19.24 7.18 1 2014 23 2353 19.78 4.65 1 2014 23 2355 26.65 42.76 1 2014 23 2356 27.34 56.356 1 2014 23 2357 29.24 45.4 1 2014 23 2359 23.23 345.21 1 2014 24 0000 12.53 1.98 1 2014 24 0001 7.24  12.3I have tried sed '/24/d' (filename)But that removes every instance of 24 throughout the file, like this (not desired!):1 2014 23 2353 19.78 4.651 2014 23 2355 26.65 42.761 2014 23 2356 27.34 56.3561 2014 23 2359 23.23 345.21
Remove a line if regex exists only in 1st column of each line in a csv file
sed;awk;regular expression;data;csv simple
With awk (prints everything with 1 at the beginning of the line):awk '/^1/{print $0}'With sed (-n option to suppress printing of everything):sed -n '/^1/p'With grep (perhaps not the best choice for text processing, but good enough in this case):grep '^1'