Sponsored Content
Top Forums Shell Programming and Scripting Remove single @ on line from file Post 303035216 by vgersh99 on Thursday 16th of May 2019 12:37:21 PM
Old 05-16-2019
for a non-GNU sed - might be harden a bit more/better:
Code:
sed 's/@[^ ][^ ]*[.][^ ][^ ]*/@REDACTED/g' myFile

This User Gave Thanks to vgersh99 For This Post:
 

10 More Discussions You Might Find Interesting

1. Programming

remove single-line comment

Does anyone knows how to write a program to remove single-line comment in C program? that means it don't read anything behind // (3 Replies)
Discussion started by: Icy002
3 Replies

2. UNIX for Dummies Questions & Answers

Trying to remove single character from a line

Here is a sample code grep '903' -i user.txt | tail -2 | awk '{print $2}' | sed 's/B//g' the input file has data as such 903-xxx-xxxxB 903-xxx-xxxxB It is a dialer file i want to remove the "B" any help thanks (5 Replies)
Discussion started by: Iz3k34l
5 Replies

3. UNIX for Dummies Questions & Answers

how to remove mutilple enrty in a single line in unix

Hi, Below is a single line output. subsD,01 02 03 04 05 00 00 00 00 07 00 05,hlr,common,00000000 subsD,01 02 03 04 05 00 00 00 00 07 00 05,hlr,01,baoc|notActive|notInduced,activeAndOperative,notActive,notActive,noneDesignated,0,notActive|00|,notActive|00|,notActive|00|,notActive|00|30|,,... (4 Replies)
Discussion started by: kaprus
4 Replies

4. Shell Programming and Scripting

Need to remove multiple text from a single file

Dear all, I have a file which have let us say records from A-Z. Now I want to remove multiple letter from this file using single command.. let us say I want to remove A,F,K,Y,U,P,B,S,D. I can use grep -v command but for this case i need to rerun the file several time i wana avoid using... (3 Replies)
Discussion started by: jojo123
3 Replies

5. Shell Programming and Scripting

awk concatenate every line of a file in a single line

I have several hundreds of tiny files which need to be concatenated into one single line and all those in a single file. Some files have several blank lines. Tried to use this script but failed on it. awk 'END { print r } r && !/^/ { print FILENAME, r; r = "" }{ r = r ? r $0 : $0 }' *.txt... (8 Replies)
Discussion started by: sdf
8 Replies

6. Shell Programming and Scripting

Formatting File having big single line into 95 Char Per Line

Hi All, I have 4 big files which contains one big line containing formatted character records, I need to format each file in such way that each File will have 95 Characters per line. Last line of each file will have newline character at end. Before:- File Name:- File1.dat 102 121340560... (10 Replies)
Discussion started by: lancesunny
10 Replies

7. UNIX for Dummies Questions & Answers

Remove multi line and single line comments

Hi, I am trying to remove multi line and single line comments like examples below I have tried this pattern. it works fine for single line comments and multi line comments in a single line only. but this fails when the comments are extended in multiple lines as shown in the comment 2 of... (3 Replies)
Discussion started by: ahmedwaseem2000
3 Replies

8. UNIX for Dummies Questions & Answers

To find and display the middle line in a file using single line command.

Hi all, How can i display the middle line of a file using a single line command? (6 Replies)
Discussion started by: Lakme Pemmaiah
6 Replies

9. UNIX for Beginners Questions & Answers

Output to file print as single line, not separate line

example of problem: when I echo "$e" >> /home/cogiz/file.txt result prints to file as:AA BB CC I need it to save to file as this:AA BB CC I know it's probably something really simple but any help would be greatly appreciated. Thank You. Cogiz (7 Replies)
Discussion started by: cogiz
7 Replies

10. Shell Programming and Scripting

Remove single-line breaks only in document

Regarding copy/pasted text of copyright-free book from archive.org (link below), in attempt to expand single-line-break paragraph text (not section headings or paragraph breaks) to wider right margin, Justify or Wrap in LIbreOffice is not working, and Find/Replace the paragraph mark ($) wraps all... (2 Replies)
Discussion started by: p1ne
2 Replies
File::Remove(3) 					User Contributed Perl Documentation					   File::Remove(3)

NAME
File::Remove - Remove files and directories SYNOPSIS
use File::Remove 'remove'; # removes (without recursion) several files remove( '*.c', '*.pl' ); # removes (with recursion) several directories remove( 1, qw{directory1 directory2} ); # removes (with recursion) several files and directories remove( 1, qw{file1 file2 directory1 *~} ); # trashes (with support for undeleting later) several files trash( '*~' ); DESCRIPTION
File::Remove::remove removes files and directories. It acts like /bin/rm, for the most part. Although "unlink" can be given a list of files, it will not remove directories; this module remedies that. It also accepts wildcards, * and ?, as arguments for filenames. File::Remove::trash accepts the same arguments as remove, with the addition of an optional, infrequently used "other platforms" hashref. SUBROUTINES
remove Removes files and directories. Directories are removed recursively like in rm -rf if the first argument is a reference to a scalar that evaluates to true. If the first arguemnt is a reference to a scalar then it is used as the value of the recursive flag. By default it's false so only pass 1 to it. In list context it returns a list of files/directories removed, in scalar context it returns the number of files/directories removed. The list/number should match what was passed in if everything went well. rm Just calls remove. It's there for people who get tired of typing remove. clear The "clear" function is a version of "remove" designed for use in test scripts. It takes a list of paths that it will both initially delete during the current test run, and then further flag for deletion at END-time as a convenience for the next test run. trash Removes files and directories, with support for undeleting later. Accepts an optional "other platforms" hashref, passing the remaining arguments to remove. Win32 Requires Win32::FileOp. Installation not actually enforced on Win32 yet, since Win32::FileOp has badly failing dependencies at time of writing. OS X Requires Mac::Glue. Other platforms The first argument to trash() must be a hashref with two keys, 'rmdir' and 'unlink', each referencing a coderef. The coderefs will be called with the filenames that are to be deleted. SUPPORT
Bugs should always be submitted via the CPAN bug tracker <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=File-Remove> For other issues, contact the maintainer. AUTHOR
Adam Kennedy <adamk@cpan.org> COPYRIGHT
Some parts copyright 2006 - 2012 Adam Kennedy. Taken over by Adam Kennedy <adamk@cpan.org> to fix the "deep readonly files" bug, and do some package cleaning. Some parts copyright 2004 - 2005 Richard Soderberg. Taken over by Richard Soderberg <perl@crystalflame.net> to port it to File::Spec and add tests. Original copyright: 1998 by Gabor Egressy, <gabor@vmunix.com>. This program is free software; you can redistribute and/or modify it under the same terms as Perl itself. perl v5.16.3 2012-03-19 File::Remove(3)
All times are GMT -4. The time now is 11:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy