tomnomnom / anew Goto Github PK
View Code? Open in Web Editor NEWA tool for adding new lines to files, skipping duplicates
License: MIT License
A tool for adding new lines to files, skipping duplicates
License: MIT License
Hi,
Thank you very much for providing useful tools like anew.
I came across the following error
fatal error: runtime: out of memory
...
main.main()
/root/src/github.com/tomnomnom/anew/main.go:27 +0x546 fp=0xc420feaf80 sp=0xc420feacc0 pc=0x495ea6
Checking further, I can see the memory usage increase when running anew.
Example:
echo "test" | anew file.txt
With a file.txt is 376MB and containing 7 364 495 lines, I can see the memory increase from
138MB to 1.2GB. This is around 3x the size of the file.txt used.
With another test file twice the size and lines, (750MB), Memory goes to 1.6GB (2x the size)
So this make anew difficult to use in some cases ( "big" files and/or low memory like RaspberryPI )
I wonder if there are some possible code modifications possible (or a new option use) to reduce/limit the memory usage (Splitting the file in smaller bits first, write temporary to disk etc... ) even if this impact the time of the operation.. ?
Thank's !
I love how anew works. I often find myself doing this, though:
cat things.txt | grep -v -f thingsidontwant.txt | t2.txt && mv t2.txt things.txt
It would be wonderful if I could do:
cat thingsidontwant.txt | anew -invert things.txt
and have anew REMOVE any items that match the input from the target file.
I'm happy to take this on but wanted to open an issue first to see if this would be worth a PR or better suited to a standalone tool.
its good but provide some more features.
thanks
Hi, I'm getting compile: version "go1.18.1" does not match go tool version "go1.20.2"
Is there a workaround for this?
So 'anew' is 'append new stuff if not already there' right?
sudo go install github.com/tomnomnom/anew@latest
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
compile: version "go1.17.2" does not match go tool version "go1.17.1"
med@med:~$ go version
go version go1.17.1 linux/amd64
go/src/github.com/tomnomnom/anew/main.go:44:3: non-bool lines[line] (type struct {}) used as if condition
Hello everyone,
My name is Marcos R Carvalho (aka oday).
I have initiated the packaging process for anew for Debian. I would like to express my gratitude for the excellent work done by the developers of anew.
I have submitted the package to the mentors repository for review by other Debian Developers (DDs). You can find the package at the following link: https://mentors.debian.net/package/anew/
The -q flag still prints all output to stdout.
go install -v github.com/tomnomnom/anew@latest No command output is displayed
why my anew windows product can`t to sure work?
it is just working on my home dir, i am not able to use it anywhere alse
getting the above error ... :)
I am running some automation. anew is part of it. when running manually it works fine. but somehow, the script breaks when run using cron. I have tried adding and removing anew in the script to make sure the problem. when I add anew, the script breaking after the line where anew is added.
Please check, reproduce and fix :-D
Right now, if there's an entry with a trailing space in the file to be appended to, anew will append another entry (without a trailing space) resulting in duplicate entries.
Please consider adding a toggle flag to ignore or not ignore white space when determining if a new entry should be appended.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.