Easily copy and paste lines of data from one file to another. Built on top of Deno

Easily copy and paste lines of data from one file to another. Built on top of Deno

Line Copy Protocol (LCP) Easily copy, paste, and delete lines of data from one file to another. Built on top of Deno.

Line Copy Protocol (LCP)

Easily copy, paste, and delete lines of data from one file to another. Built on top of Deno.

Usage

# Syntax: lcp <filename> <lines> <filename> <line>
# Syntax: lcp <filename> <lines> <filename> <lines>

lcp test1.txt 1:3 test2.txt 1:3
# Explanation: Copy lines 1 to 3 of test1.txt into lines 1 to 3 of test2.txt.
# Note: Lines 1 to 3 and any that follow of test2.txt will be appended after the insert.

lcp test1.txt 2 test2.txt 3
# Explanation: Copy line 2 of test1.txt into line 3 of test2.txt.
# Note: Line 3 any any lines that follow of test2.txt will be appended after the insert.

lcp test1.txt 1:2 test2.txt 1:4
# Explanation: Replace lines 1:4 of test2.txt with lines 1:2 of test1.txt
# Note: The best way to explain this is with a anecdote of a visual text editor.
# You highlight lines 1:4 and copy them, then highlight lines 1:2 and paste lines 1:4
# in place of lines 1:2.

Installation

Install with deno

deno install --unstable --allow-read --allow-write -n lcp http://deno.land/x/linecopyprotocol/LCP.ts

And lcp will be installed!

lcp
# Line Copy Protocol
# `lcp help` for help
# Happy hacking!

You may also build from source

chmod +x LCP.ts

./LCP.ts file1 1:2 file2 2:4
# or deno run --unstable --allow-read --allow-write LCP.ts file1 1:2 file2 2:4

The source code is MIT licensed and can imported into your project with:

import { lineCopyProtocol } from "https://deno.land/x/linecopyprotocol/src/lineCopyProtocol.ts"

Disclaimer

This is a small tool I worked up while learning Deno. The technical specifications are open to contributions and ideas. For ideas and suggestions please open an issue. For pull requests please update tests as necessary.

Download Details:

Author: paulmj7

Source Code: https://github.com/paulmj7/linecopyprotocol

deno nodejs node javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

AEM Querybuilder for JavaScript (Browser, Node, Deno)

Helix Querybuilder .AEM Querybuilder for JavaScript (Browser, Node, Deno)

NKeys for JavaScript - Node.js, Browsers, and Deno

A public-key signature system based on Ed25519 for the NATS ecosystem system for JavaScript. The nkeys.js library works in Deno, Node.js, and the browser!

Javascript module for easily generating mazes,compatible with both Deno and Node

A work-in-progress Javascript maze generator module, compatible with both Deno and Node.

Deno Tutorial for Beginners: Deno vs. Node: Better Than NodeJS?

Deno is released, it’s time to find out if it can prove a worthy competition for Node.js. What is Deno? Why Deno can be considered an alternative to Node? The main differences between Deno and Node. Write a simple Deno app.

What is Deno? The Node.JS Killer? The Deno-minator to Node?

What is Deno? The Node.JS Killer? The Deno-minator to Node? Deno is the new hype and will it be better than node.js? Deno is a secure runtime for JavaScript and TypeScript that is based on the V8 JavaScript engine and the Rust programming language that addresses Node’s shortcomings