I need to write a script where it will check for : blank lines (between rows,before first line and after last line) and remove them. Also if there are any blank records between the "|" delimeter it will identify the row number and send a mail. Finally in case there are "junk characters" it will identify and remove them. How should I go about it?
I know what a blank line is. What is a ": blank line"? Is it a blank line that can contain colons in addition to <space>s and <tab>s?
By definition, a blank line only contains characters in the character class blank and the character | is never a member of that character class. So, what do you really mean by "blank records between the "|" delimiter"?
All of the characters in the 1st two fields of the 1st three lines of your sample ABC.TXT look like "junk characters" to me. What is your definition of a junk character? If " KJHSAJKHHJJ" isn't junk, what is it?
Hi,
I am trying to do two things in my script. I will really appreciate any help in this regards.
Is there a way to delete a last line from a pipe delimited flat file if the last line is blank. If the line is not blank then do nothing.....
Is there a way to count a word that are starting... (4 Replies)
Dear All
I want to do following task. Kindly suggest.
In my script every hour one file is genarated. say xyz.txt.
Now if this file contain some data then i want to do task A and if file is blank then i want to do nothing.
Kindly help me to do this.
regards
jaydeep (5 Replies)
Hi Guys,
I have been trying to remove blank lines from a file with no success. I tried using all the following options on the file:
tr -s '\n' < abc.txt
grep -v "^$" abc.txt
sed '/^$/d' abc.txt
sed '/./!d' abc.txt
awk '/./' abc.txt
The file is a text file. (11 Replies)
Hi,
Consider a file named "testfile"
The contents of file are as below
first line added for test
second line added for test
third line added for test
fourth line added for test
fifth line added for test (5 Replies)
Hi All,
I have a file and I need to delete the lines that are blank and is starting with some characters below. Something like below:
Regular Ascii File:
Line1: AGODA1 BUSAN||SK Lord Beach 4/6/2012 4/7/2012 68060
Line2: AGODA2 BUSAN||SK Beach Hotel 4/6/2012 4/7/2012 610200
Line3: ... (4 Replies)
Hello All,
I have a file with data as below. Each line consists of 21 fields. I am not able to load them back to the database.
50733339,"834","834 ","005010X279A1","N","Y","007977163","0001 ",30,"2110D ","EB ","EB007 ","2 ","Conditional Required Data Element Miss
ing... (3 Replies)
Hi All,
How do i remove continuos blank lines from a file.
I have a file with data:
abc;
def;
ghi;
jkl;
mno;
pqr;
In the above file, there are two blank lines. I want to remove, one out of them.
My output should look like: (2 Replies)
Hi,
I am using KSH.
I am trying to check if the output file is empty or not.
I tried with ] but what i see is my file is empty but still manages to have a size of 1 instead of 0.
But my file doesnot have anything its empty.
I am not sure how to check this.
can any one help? (10 Replies)
I have a file with the following format:
X|High|2|GIC|DM||XHM|||6 Months
X|Moderate|2|GIC|DM||XHM|||6 Months
X|High|2|GCM|DM||XSF|||6 Months
X|Med|2|GCM|DM||XSF|||6
Here there are ten columns but I need to print rows having blank records in any of the rows (except for 6th,8th and 9th... (10 Replies)
Discussion started by: chatwithsaurav
10 Replies
LEARN ABOUT DEBIAN
pmksyntax
PMKSYNTAX(5) BSD File Formats Manual PMKSYNTAX(5)NAME
PMK Syntax -- PMK files syntax manual
DESCRIPTION
This manual page describe the basic syntax used in PMK files such as pmkfile and scanfile
DATA TYPES
PMK uses pseudo types like the following:
bool The classical boolean type with TRUE and FALSE values.
For example:
TRUE
FALSE
identifier An identifier is a string of alphanumerical and underscores characters.
For example:
REQUIRED
a_label
underscores_are_nice
quoted This means quoted string which can contain a set of characters delimited by quotation marks.
For examples:
"simple quoted string"
"string that contain "quotes" backslashed"
"can also contain filenames like pmkfile.scan"
list It is one or more of the previous types between brackets. Multiple objects are separated with a comma. Blanks are currently not
allowed beside commas, this means that you can find them only in a quoted string of the list.
For example:
("only_one_string")
("added a boolean",TRUE)
(mixed_list_of,"words","and",TRUE,"quoted strings")
BASIC SYNTAX
PMK can contain comments, blank lines and commands.
A command has the following format (? character means optional field):
<command><?(label)> {
<body>
}
The command and label names can be assimilated to the 'word' type. See DATA TYPES above.
The body can contain comment(s) and definition line(s). A commented line start with a '#' character like the following:
# this is a comment line
A definition line has the following format:
<?blank><key name><?blank>=<?blank><key value>
The key name is of identifier type.
The key value type can be 'bool', 'quoted' or 'list'. The right type will depend on the key name (see further).
For example:
CHECK_INCLUDE(header_sys_param) {
# following options use different uses of blank characters
# key value is word type
REQUIRED = TRUE
# key value is list type
DEPEND= ("dep_one",dep_two,"dep_three")
# key value is quoted type
INCLUDE = "sys/param.h"
}
SEE ALSO pmkfile(5), scanfile(5)BSD November 5, 2005 BSD