Hi,
I have several files with data that have to be imported to a database. These files contain records with separator characters. Some records are corrupt (2 separators are missing) and I need to correct them prior to importing them into the db.
Example:
... (5 Replies)
I'm trying find and print a number after a specific user passed string in each line of a text file using C (as requested by the powers that be). I've pieced together enough to read the file, find the string and print the line it was found on but I’m not sure where to even start in terms of finding... (3 Replies)
For example i'm having the below contents in a file:
expr is great when you want to split a string into just two parts. The .* also makes expr good for skipping a variable number of words when you don't know how many words a string will have. But expr is lousy for getting, say, the fourth word... (2 Replies)
Greetings experts. Searched the forums (perhaps not hard enough?) - Am searching for a method to capture all output from a log file following the nth occurrence of a known string.
Background:
Using bash, I want to monitor my Oracle DB alert log file. The script will count the total # of... (2 Replies)
if there's a file containing:
money king money queen money cat money also money king
all those strings are on one line in the file.
how can i find out how many times "money king" shows up in the line?
egrep -c "money king" wont work. (7 Replies)
Hello All,
I want to check if a delimiter is existing twice in a line of a text file.
Suppose flat file is like this
234 | 123
123 | 345
456 | 563 |
234 | 548
So the the 3rd line has two delimiters,
How can we find the lines in such a file having more then one delimiters
I tried... (5 Replies)
Bash/Oracle Linux 6.4
A basic requirement.
How can I get nth line of a file printed ? Can I use grep in this case ?
Example:
In the below file, 12th line is "Kernel parameter check passed for rmem_max" . I just want the 12 line to be printed.
# cat sometext.txt
Kernel version check... (2 Replies)
Hi,
I would like to know how, using sed, be able to insert contents of file2 in file1 after say the second occurrence of a given string? e.g.
> cat file1
banana
apple
orange
apple
banana
pear
tangerine
apple
> cat file2
I don't like apples
What would be the sed command to insert... (5 Replies)
Hi
I want to use awk to match where field 3 contains a number within string - then print the line and just the number as a new field.
The source file is pipe delimited and looks something like
1|net|ABC Letr1|1530|||
1|net|EXP_1040 ABC|1121|||
1|net|EXP_TG1224|1122|||
1|net|R_North|1123|||... (5 Replies)
My file (the output of an experiment) starts off looking like this,
_____________________________________________________________
Subjects incorporated to date: 001
Data file started on machine PKSHS260-05CP
**********************************************************************
Subject 1,... (9 Replies)
Discussion started by: samonl
9 Replies
LEARN ABOUT DEBIAN
genbackupdata
GENBACKUPDATA(1) General Commands Manual GENBACKUPDATA(1)NAME
genbackupdata - generate backup test data
SYNOPSIS
genbackupdata [--chunk-size=SIZE] [--config=FILE] [-c=SIZE] [--create=SIZE] [--depth=DEPTH] [--dump-config] [--dump-setting-names]
[--file-size=SIZE] [--generate-manpage=TEMPLATE] [-h] [--help] [--list-config-files] [--log=FILE] [--log-keep=N] [--log-level=LEVEL]
[--log-max=SIZE] [--max-files=MAX-FILES] [--no-default-configs] [--output=FILE] [--quiet] [--seed=SEED] [--version]
DESCRIPTION
genbackupdata generates test data sets for performance testing of backup software. It creates a directory tree filled with files of dif-
ferent sizes. The total size and the distribution of sizes between small and big are configurable. The program can also modify an exist-
ing directory tree by creating new files, and deleting, renaming, or modifying existing files. This can be used to generate test data for
successive generations of backups.
The program is deterministic: with a given set of parameters (and a given pre-existing directory tree), it always creates the same output.
This way, it is possible to reproduce backup tests exactly, without having to distribute the potentially very large test sets.
The data set consists of plain files and directories. Files are either small text files or big binary files. Text files contain the
"lorem ipsum" stanza, binary files contain randomly generated byte streams. The percentage of file data that is small text or big binary
files can be set, as can the sizes of the respective file types.
Files and directories are named "fileXXXX" or "dirXXXX", where "XXXX" is a successive integer, separate successions for files and directo-
ries. There is an upper limit to how many files a directory may contain. After the file limit is reached, a new sub-directory is created.
The first set of files go into the root directory of the test set.
You have to give one of the options --create, --delete, --rename, or --modify for the program to do anything. You can, however, give more
than one of them, if DIR already exists. (Giving the same option more than once means that only the last instance is counted.) (DIR) is
created if it doesn't exist already.
OPTIONS --chunk-size=SIZE
generate data in chunks of this size (default: 16384)
--config=FILE
add FILE to config files
-c, --create=SIZE
how much data to create (default: 0)
--depth=DEPTH
depth of directory tree (default: 3)
--dump-config
write out the entire current configuration
--dump-setting-names
write out all names of settings and quit
--file-size=SIZE
size of one file (default: 16384)
--generate-manpage=TEMPLATE
fill in manual page TEMPLATE
-h, --help
show this help message and exit
--list-config-files
list all possible config files
--log=FILE
write log entries to FILE
--log-keep=N
keep last N logs (10)
--log-level=LEVEL
log at LEVEL, one of debug, info, warning, error, critical, fatal (default: debug)
--log-max=SIZE
rotate logs larger than SIZE, zero for never (default: 0)
--max-files=MAX-FILES
max files/dirs per dir (default: 128)
--no-default-configs
clear list of configuration files to read
--output=FILE
write output to FILE, instead of standard output
--quiet
do not report progress
--seed=SEED
seed for random number generator (default: 0)
--version
show program's version number and exit
EXAMPLES
Create data for the first generation of a backup:
genbackupdata --create=10G testdir
Modify an existing set of backup data to create a new generation:
genbackupdata -c 5% -d 2% -m 5% -r 0.5% testdir
The above command can be run for each new generation.
GENBACKUPDATA(1)