Hi ppl.
I have to check for duplicate files in a directory .
the directory has following files
/the/folder /containing/the/file
a1.yyyymmddhhmmss
a1.yyyyMMddhhmmss
b1.yyyymmddhhmmss
b2.yyyymmddhhmmss
c.yyyymmddhhmmss
d.yyyymmddhhmmss
d.yyyymmddhhmmss
where the date time stamp can be... (1 Reply)
Hi,
is it possible to remove all duplicate lines from all txt files in a specific folder?
This is too hard for me maybe someone could help.
lets say we have an amount of textfiles 1 or 2 or 3 or... maximum 50
each textfile has lines with text.
I want all lines of all textfiles... (8 Replies)
Hi
I have been struggling with a script for removing duplicate messages from a shared mailbox.
I would like to search for duplicate messages based on the “Message-ID” string within the messages files.
I have managed to find the duplicate “Message-ID” strings and (if I would like) delete... (1 Reply)
Hi all.
Am doing continuous backup of mailboxes using rsync.
So whenever a new mail arrives it is automatically copied on backup server.
When a new mail arrives it is named as xyz:2, when it is read by the email client an S is appended xyz:2,S
Eventually , 2 copies of the same file exist on... (7 Replies)
Dear All,
I have multiple files having number of records, consist of more than 10 columns some column values are duplicate and i want to remove these duplicate values from these files.
Duplicate values may come in different files.... all files laying in single directory..
Need help to... (3 Replies)
dear all,
i'm preparing a script which can do these actions :
1. stop remove server's certain service
2. clean the files on remote servers simultaneously (because lots of files need to be deleted)
3. after files/logs are removed, restart the service again
i'm stuck on how to clean remote... (4 Replies)
Hi,
In a directory, e.g. ~/corpus is a lot of files and subdirectories. Some of the files are named:
12345___PP___0902___AA.txt
12346___PP___0902___AA. txt
12347___PP___0902___AA. txt
The amount of files varies. I need to keep the highest (12347___PP___0902___AA. txt) and remove... (5 Replies)
Hi All,
Please help me for a shell. I am a New to unix
I am trying to DB dump file from one server and copying it to another server.
From My Local ServerA connecting to remote ServerB using ssh and taking dump of a instance. That Dump file i need to copy to ServerC.
I am able to connect... (6 Replies)
So, I have text files,
one "fail.txt"
And one
"color.txt"
I now want to use a command line (DOS) to remove ANY line that is PRESENT IN BOTH from each text file.
Afterwards there shall be no duplicate lines. (1 Reply)
TARGET_DIR='/media/andy/MAXTOR_SDB1/Ubuntu_Mate_18.04/'
REGEX='{4}-{2}-{2}_{2}:{2}' # regular expression that match to: date '+%Y-%m-%d_%H:%M'
LATEST_FILE="$(ls "$TARGET_DIR" | egrep "^${REGEX}$" | tail -1)"
find "$TARGET_DIR" ! -name "$LATEST_FILE" -type f -regextype egrep -regex... (7 Replies)
Discussion started by: drew77
7 Replies
LEARN ABOUT PLAN9
getfields
GETFIELDS(2) System Calls Manual GETFIELDS(2)NAME
getfields, getmfields, setfields, tokenize - break a string into fields
SYNOPSIS
#include <u.h>
#include <libc.h>
int getfields(char *str, char **ptrs, int nptrs)
int getmfields(char *str, char **ptrs, int nptrs)
char* setfields(char *fielddelim)
int tokenize(char *str, char **args, int max)
DESCRIPTION
Getfields breaks the null-terminated string str into at most nptrs null-terminated fields and places pointers to the start of these fields
in the array ptrs. It returns the number of fields and terminates the list of pointers with a zero pointer. It overwrites some of the
bytes in str. If there are nptr or more fields, the list will not end with zero and the last `field' will extend to the end of the input
string and may contain delimiters.
A field is defined as a maximal sequence of characters not in a set of field delimiters. Adjacent fields are separated by exactly one
delimiter. No field follows a delimiter at the end of string. Thus a string of just two delimiter characters contains two empty fields,
and a nonempty string with no delimiters contains one field.
Getmfields is the same as getfields except that fields are separated by maximal strings of field delimiters rather than just one.
Setfields makes the field delimiters (space and tab by default) be the characters of the string fielddelim and returns a pointer to a
string of the previous delimiters.
Tokenize breaks null-terminated string str into tokens by replacing every blank or newline with a null byte. Pointers to successive non-
empty tokens are placed in args. Processing stops after max tokens are processed. Tokenize returns the number of tokens processed. Tok-
enize does not terminate args with a null pointer.
Alef
Of these routines, only tokenize is in Alef.
SOURCE
/sys/src/libc/port/getfields.c
/sys/src/libc/port/tokenize.c
SEE ALSO
strtok in strcat(2)GETFIELDS(2)