Skip to content

Instantly share code, notes, and snippets.

@andybell
Created November 3, 2015 20:14
Show Gist options
  • Save andybell/652cae137dc7e9f74446 to your computer and use it in GitHub Desktop.
Save andybell/652cae137dc7e9f74446 to your computer and use it in GitHub Desktop.
quickly subset point cloud text file
#!/bin/bash
# uses grep wildcard to get a subset of a XYZ pointcloud
# usage: file_in, file_out, x, y
# echo arguments to the shell
echo $1 $2 $3 $4
in=$1
out=$2
x=$3
y=$4
# example coord 629483.027229309200 4465266.981443485200
grep $x* $in > tmp
grep $y* tmp > $out
leng=$(wc -l $out)
echo $leng 'matches'
rm tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment