Sponsored Content
Top Forums Shell Programming and Scripting To check Blank Lines, Blank Records and Junk Characters in a File Post 302943423 by sea on Friday 8th of May 2015 08:22:34 AM
Old 05-08-2015
We need a better preparations of your post.
Use code tags as required by the forum rules.

What have you tried so far?
REAL code, not nonworking-abreviahted pseudo code.

The above saying (would) show the respect many people here deserves as they are trying to help you.
And its absolute annoying to ask for every single bit.

What is your definition of 'get a better syntax', while you not provide a valid/(basicly) working syntax at all.

Besides, there are NO SPACECHARS at all in your textfile.
AGAIN, USE CODE TAGS!
And provide samples AS-IS. (example: not a 2TB database, but a few lines of actual data to work with)

Thank you, have a nice weekend

Last edited by sea; 05-08-2015 at 11:02 AM..
This User Gave Thanks to sea For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting the blank line in a file and counting the characters....

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)
Discussion started by: rkumar28
4 Replies

2. Shell Programming and Scripting

how to check weather file is blank or not?

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)
Discussion started by: jaydeep_sadaria
5 Replies

3. Shell Programming and Scripting

Can't remove blank lines from a file

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)
Discussion started by: npatwardhan
11 Replies

4. Shell Programming and Scripting

Delete blank lines, if blank lines are more than one using shell

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)
Discussion started by: anil8103
5 Replies

5. Shell Programming and Scripting

Delete blank lines in a file

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)
Discussion started by: rkumar28
4 Replies

6. Shell Programming and Scripting

Reform Lines in File without blank lines and spaces

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)
Discussion started by: Praveenkulkarni
3 Replies

7. Shell Programming and Scripting

Removing blank lines from a file

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)
Discussion started by: raosr020
2 Replies

8. Shell Programming and Scripting

How to check if the file is empty or has blank space.?

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)
Discussion started by: Sharma331
10 Replies

9. UNIX for Advanced & Expert Users

Delete blank spaces and blank lines in a file

Hi Gurus, Somebody can say me how to delete blank spaces and blank lines in a file unix, please. Thank you for advanced. (10 Replies)
Discussion started by: systemoper
10 Replies

10. Shell Programming and Scripting

Script to find blank records in a file except for few columns

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
ctype(3)						     Library Functions Manual							  ctype(3)

Name
       isalpha,  isupper,  islower,  isdigit,  isxdigit,  isalnum, isspace, ispunct, isprint, isgraph, iscntrl, isascii - character classification
       macros

Syntax
       #include <ctype.h>

       int isalpha (c)

       int c;

Description
       These macros classify character-coded integer values according to the rules of the coded character set (codeset)  identified  by  the  last
       successful call to category All macros return non-zero for true and zero for false.

       If  category  has  not been called successfully, or if character classification information is not available for a supported language, then
       characters are classified according to the rules of the ASCII 7-bit coded character set, returning 0 for values above octal 0177.

       The macro provides a result for all integer values.  The rest provide a result for EOF and values in the character  range  of  the  codeset
       identified by the last successful call to category

       c	      is a letter

       c	      is an uppercase letter

       c	      is a lowercase letter

       c	      is a digit

       c	      is a hexadecimal digit, by default [0-9], [A-F], or [a-f]

       c	      is an alphanumeric character

       c	      is a space, tab, carriage return, new line, or form feed

       c	      is a punctuation character (neither control, alphanumeric, nor space)

       c	      is a printing character, by default code 040(8) (space) through 0176 (tilde)

       c	      is a printing character, like except false for space

       c	      is a delete character(0177) or ordinary control character (less than 040) except for space characters

       c	      is an ASCII character, code less than 0200

   International Environment
       LC_CTYPE       If this environment variable is set and valid, uses the international language database named in the definition to determine
		      character classification rules.

       LANG	      If this environment variable is set and valid, uses the international language database named in the definition to determine
		      the character classification rules. If is defined, that definition supercedes the definition of

See Also
       conv(3), setlocale(3), stdio(3s), environ(5int), ascii(7)
       Guide to Developing International Software

																	  ctype(3)
All times are GMT -4. The time now is 02:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy