Skip to content

Instantly share code, notes, and snippets.

@paullewallencom
Created July 24, 2018 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paullewallencom/6cad1766c53e9b5fa35f7c6940961816 to your computer and use it in GitHub Desktop.
Save paullewallencom/6cad1766c53e9b5fa35f7c6940961816 to your computer and use it in GitHub Desktop.
Concatenates text files and outputs the result to a file.
public class Cat
{
private Cat() { }
public static void main( String[] args )
{
Out out = new Out( args[ args.length - 1 ] );
for ( int i = 0; i < args.length - 1; i++ )
{
In in = new In( args[i] );
String s = in.readAll();
out.println(s);
in.close();
}
out.close();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment