Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Exclude new line character while searching Post 302664269 by methyl on Friday 29th of June 2012 08:09:04 AM
Old 06-29-2012
Once you remove all the text file line terminators the file is no longer a standard unix text file and is unsuitable for processing in unix shell tools.

What is the record format of the input file? Is is fixed length records or variable length records?

A possible method might be to create two versions of the input file, one with every even numbered line terminator removed and one with every odd numbered line terminator removed. Then search both files to determine if the string is present.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

searching for $ character

I need to search in text files for the $ character. I tried putting it in double quotes and single quotes . ie grep "$" filename but unix finds everything in the file. Whats the best way to do this? thanks (4 Replies)
Discussion started by: MizzGail
4 Replies

2. Shell Programming and Scripting

Searching a string for a character

I have a co-worker that is trying to make a Wheel of Fortune game and he wants to know if there is a way to search a string for the letter given by the user. (7 Replies)
Discussion started by: turbulence
7 Replies

3. Shell Programming and Scripting

exclude a line

Hi, thanks for your help. I wrote this script : # ! /bin/sh file=snapshot.txt cat $file | while read line ; do { myvariable=`grep "Nombre de ROLLBACK internes" |sed 's/.*.=//'` echo $myvariable } done It looks in a file "snapshot.txt" for the lines containing "Nombre de ROLLBACK... (3 Replies)
Discussion started by: big123456
3 Replies

4. UNIX for Dummies Questions & Answers

Searching a particular character in a file

Hi, I want to search how many times is "a" present in a file named "data". How to do this? Please help (4 Replies)
Discussion started by: gautamshaw
4 Replies

5. HP-UX

How to remove new line character and append new line character in a file?

Hi Experts, I have data coming in 4 columns and there are new line characters \n in between the data. I need to remove the new line characters in the middle of the row and keep the \n character at the end of the line. File is comma (,) seperated. Eg: ID,Client ,SNo,Rank 37,Airtel \n... (8 Replies)
Discussion started by: sasikari
8 Replies

6. Shell Programming and Scripting

Have to exclude the first and last line of the file : help me

hi , i am very new to perl . scriptting.. pllease can any one help me ...pleaseeeeeee i ll have a file which look likes 123 |something |567 456 |welcome |789 457 |inboxpost |790 . . 123 |something |567 i have to execute all the lines in the file except the first and the... (14 Replies)
Discussion started by: vishwakar
14 Replies

7. Shell Programming and Scripting

Awk: Searching for length of words between slash character

Dear UNIX Community, I have a set of file paths like the one below: \\folder name \ folder1 \ folder2 \ folder3 \ folder4 \\folder name \ very long folder name \ even longer name I would like to find the length of the characters (including space) between the \'s. However, I want... (6 Replies)
Discussion started by: vnayak
6 Replies

8. Shell Programming and Scripting

exclude blank line

hi, how can i exclude blank line along with #, in the below command. crontab -l|grep -v "^#" |wc -l thx (3 Replies)
Discussion started by: bang_dba
3 Replies

9. Shell Programming and Scripting

Searching Alphanumeric Character From a File

Hi, In a error log file, the error code of a particular error contains both Alphabet and Numbers. My problem statement is to find the error codes from a particular log. That means, I need to search a word, which contains both alphabet and number. Please help me. Below is two examples of error... (1 Reply)
Discussion started by: snehasish_jana
1 Replies

10. Shell Programming and Scripting

Searching invalid character in list of client name

Hi Friend, I have a client name list and client name has some invalid character due to which some issue raised and list of client are15k. I want to make script who find invalid character name. can you please help me how i can make script, i means i need logic. Valid character are :- ... (5 Replies)
Discussion started by: pallvi_mahajan
5 Replies
db_load(8)						      System Manager's Manual							db_load(8)

NAME
db_load - Loads standard input to a database files (Enhanced Security) SYNOPSIS
/usr/tcb/bin/db_load [-nT] [-c name=value] [-f file] [-h home] [-t btree|hash|recno] db_file FLAGS
Specify configuration options for the DB_INFO structure provided to db_open ignoring any value they may have been based on the input. The command-line format is name=value. The following keywords are supported: The minimum number of keys per page. The byte order for integers in the stored database metadata. The size of pages used for nodes in the tree, in bytes. The value of the DB_DUP flag. The density within the hash table. The size of the hash table. Specify fixed-length records of the specified length. Specify the fixed-length record pad character. The value of the DB_RECNUM flag. The value of the DB_RENUMBER flag. The parenthetical listing specifies how the value part of the name=value pair is interpreted. Items listed as (boolean) expect value to be 1 (set) or 0 (unset). Items listed as (number) convert value to a number. Items listed as (string) use the characters of value directly. Read from the specified input file, instead of from the standard input. Specify a home directory for the database. The correct directory for enhanced security is /var/tcb/files. Do not overwrite existing keys in the database when loading into an already existing database. If a key/data pair cannot be loaded into the database for this reason, a warning message is displayed on the standard error output and the key/data pair are skipped. The -T option allows non-Berkeley DB applications to easily load text files into databases. If the database to be created is of type btree or hash, the input must be paired lines of text, where the first line of the pair is the key item, and the second line of the pair is its corresponding data item. If the database to be created is of type recno, the input must be lines of text, where each line is a new data item for the database. A simple escape mechanism, where newline and backslash () characters are special, is applied to the text input. Newline characters are interpreted as record separators. Backslash characters in the text will be interpreted in one of two ways: If the backslash character pre- cedes another backslash character, the pair will be interpreted as a literal backslash. If the backslash character precedes any other character, the two characters following the backslash will be interpreted as hexadecimal specification of a single character, that is, a is a newline character in the ASCII character set. For this reason, any backslash or newline characters that naturally occur in the text input must be escaped to avoid misinterpretation by db_load. If the -T option is specified, the underlying access method type must be specified using the -t option. Specifies the underlying access method. If no -t option is specified, the database will be loaded into a database of the same type as was dumped, that is, a hash database is created if a hash database was dumped. The btree and hash databases may be converted from one to the other. The recno databases may not be converted to any other database type or from any other database type. DESCRIPTION
A customized version of the Berkeley Database (Berkeley DB) is embedded in the operating system to provide high-performance database sup- port for critical security files. The DB includes full transactional support and database recovery, using write-ahead logging and check- pointing to record changes. The db_load utility reads from the standard input and loads it into the db_file database . The database db_file is created if it does not already exist. The input to db_load must be in the output format specified by the db_dump utility or as specified for the -T option. The db_load utility utility attaches to one or more of the Berkeley DB shared memory regions. In order to avoid region corruption, it should always be given the chance to detach and exit gracefully. To cause db_load to clean up after itself and exit, send it an interrupt signal (SIGINT). The db_load utility can be used to load text files into the security databases. It is used by Tru64 UNIX utilities and is not recommended for use by system administration. The edauth utility provides a supported means of loading records correctly into the security databases. RETURN VALUES
The db_load utility exits 0 on success, and >0 if one or more key/data pairs were not loaded into the database because the key already existed, and with >1 if an error occurs. ENVIRONMENT VARIABLES
If the -h option is not specified and the environment variable DB_HOME is set, it is used as the path of the database home. The home directory for security is /var/tcb/files. FILES
/var/tcb/files/auth.db /var/tcb/files/dblogs/* RELATED INFORMATION
Files: authcap(4) Commands: edauth(8), db_dump(8) delim off db_load(8)
All times are GMT -4. The time now is 01:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy