I finally figured it out, this may help someone in the future so I'm posting what I came up with.
tr -cd '\11\12\15\40-\176' <Filebefore.txt > Fileafter.txt
I created a .scp file and ran it, it appears to run the script but the output file is empty. Here's what I've got
gawk -f scpfiles\nonascii.scp file1.txt > file2.txt
in the scp file I've got
{
gsub(/[^ -~]/,"",$0)
}
The txt file I'm working with has 2.3 million lines.
I'm a awk virgin, however a system we have in place already uses this program with other scripts. I'm needing a command to remove all non-ascii characters from a 180mb .txt file.
One of the commands is this:
gawk -f scpfiles\Test.scp TEST.TXT > TEST.list
Which points to this script file:
{...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.