Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Cat command drops lines in output file Post 302744145 by Xin Xin on Friday 14th of December 2012 12:26:50 AM
Old 12-14-2012
Data Cat command drops lines in output file

I use the cat command to concatenate text files, but one of the rows I was expecting doesn't display in the output file. Is there a verbose mode\logging mechanism for the cat command to help me investigate where the lines I was expecting are going??

Code:
 
cat 7760-001_1_*_06_*.txt | grep -v RECORD_SOURCE_SYSTEM_CODE > /data/EIRwork/DataMigration/SSWLHD/06112012_SSW-01_200k_batch/out_files/06.out

to concatenate files.

one of the files 7760-001_1_67_06_2008-02-09t14x54x52.txt contains the following rows (I've cut down the number of columns and inserted string '[null]' for clarity)

A~ZAPPA~Baby of Gigi~[null]~Miss~20080209~20120628
A~ZAPPA~KIM ~[null]~Miss~20120628~20120628
L~ZAPPA~Kim ~[null]~Miss~20120628~[null]


Only 2 of the rows I was expecting make it to the 06.out file (the top 2)
A~ZAPPA~Baby of Gigi~[null]~Miss~20080209~20120628
A~ZAPPA~KIM ~[null]~Miss~20120628~20120628

I don't really know where to begin with this one, or if I've provided enough information.

This concatentates 31 files
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to input the CAT command output in Shell

Hi guys... I am new to this scripting...so please forgive me if anything worng in my questions... here is my question.. I have file structure /home/oracle/<sid>/logs/bkup now i want to write a script which should grep the sid name from a file..and it should replace the <SID> with... (1 Reply)
Discussion started by: troubleurheart
1 Replies

2. Shell Programming and Scripting

cat file and parse output

Hello, I'm new to shell scripting and did a search on the forum to what I want to do but couldn't find anything. I have about 9 routers that outputs to 1 syslog file daily named cisco.year.mo.date.log ex: cisco.2009.05.11.log My goal is to make a parsing script that cats today's syslog... (2 Replies)
Discussion started by: jjrambar
2 Replies

3. Shell Programming and Scripting

Cat Command and Blank Lines

Hi All, I was testing for blank lines and I want to use the cat command only for groupline in `cat /home/test/group` do if then echo "blank found" fi done I want to check if the current line read is a blank line. I have tested with $groupline="\n" ,... (11 Replies)
Discussion started by: datkan
11 Replies

4. Shell Programming and Scripting

Read 2 lines from File, Run Command based off output

Okay, so I have a file containing line after line of three digit numbers. I need a script that does an action based on the last two numbers in this list. So.... To get the last two numbers, I can have the script do tail -2 filename.txt But where I run into trouble is as follows. If... (6 Replies)
Discussion started by: UCCCC
6 Replies

5. Shell Programming and Scripting

Cat Command on File not printing "Blank" Lines?

Hello All, I have a bash script and in it at some point I call an Expect Script that does some stuff and saves its output in a ".txt" file. Example "/path/to/my/file/Expect_Output.txt" file: notice the 2nd line is empty in the file... Data for Host-1 (192.168.1.110) Checking the... (2 Replies)
Discussion started by: mrm5102
2 Replies

6. Shell Programming and Scripting

Cat writing only one record in the output file

Hi All, I have an input file containing data as below: Input.DAT XXXXXXX|YYYYYYY|ZZZZZZZZZZ|12334446456|B|YY|111111111|111111111|111111111|111111111|15|3|NNNNNN|Y|3|AAA|111111111... (11 Replies)
Discussion started by: sagar.cumar
11 Replies

7. Shell Programming and Scripting

Getting output from a file similar to cat output

I have a file # cat /root/llll 11 22 33 44 When I cat this file content to a variable inside a shell script and echo that shell script, it does not show up as separate lines. I need echo output similar to cat. cat /root/shell_script.sh #!/bin/bash var=`cat /root/llll` echo $var (2 Replies)
Discussion started by: anil510
2 Replies

8. UNIX for Dummies Questions & Answers

Cat Input & Output to a Log file

Team, we use below command to store the contents in a logfile. cat a.txt > a.log a.txt content is 123 345 Is there any options available to store the command used also? for eg a.log may show as cat a.txt 123 345 (5 Replies)
Discussion started by: sid2013
5 Replies

9. UNIX for Dummies Questions & Answers

Remove blank lines using cat command

plz help me to figure it out how i remove empty or blank files using cat command. i will be very thankful if u send me this answer... thanks (3 Replies)
Discussion started by: mushfiks1
3 Replies

10. Shell Programming and Scripting

Ssh cat file output into a file on local computer

Hello, I'm on a remote computer by SSH. How can I get the output of "cat file" into a file on the local computer? I cannot use scp, because it's blocked. something like: ssh root@remote_maschine "cat /file" > /locale_machine/file :rolleyes: (2 Replies)
Discussion started by: borsti007
2 Replies
MISSIDENTIFY(1) 						  Jesse Kornblum						   MISSIDENTIFY(1)

NAME
missidentify - Find executable files without an executable extension SYNOPSIS
missidentify [-rqablv] [-s|-S len] [-Vh] [FILES] DESCRIPTION
Miss Identify looks at the header of every file it processes and determines if it is a PE executable (Windows executable). Such files can include programs, device drivers, and DLLs. By default the program displays the filename if the extension of the file does not match one of the known executable extensions (.exe, .com, .sys, or .dll). Other options can make the program display the filename of all executable files. -r Enables recursive mode. All subdirectories are traversed. Please note that recursive mode cannot be used to examine all files of a given file extension. For example, calling missidentify -r *.txt will examine all files in directories that end in .txt. -q Silent mode. All error messages except fatal errors are surpressed. -a Display filenames of all executables -b Enables bare mode. Strips any leading directory information from displayed filenames. This flag may not be used in conjunction with the -l flag. -l Enables relative file paths. Instead of printing the absolute path for each file, displays the relative file path as indicated on the command line. This flag may not be used in conjunction with the -b flag. -v Verbose mode. Displays the name of every 10th file as a progress indicator. -s-S len Prints strings of length len with each filename. With lowercase letter, puts filename before string. With uppercase letter, puts strings before filename. -h Show a help screen and exit. -V Show the version number and exit. BUGS
The program can be fooled by any file with more than 1024 bytes between the MZ header and the PE header. AUTHOR
Miss Identify was written by Jesse Kornblum http://missidentify.sf.net/ COPYRIGHT
Copyright (C) 2008 Jesse Kornblum. This is free software. You may redistribute copies of it under the terms of the GNU General Public License version 2. There is NO WARRANTY. See the file COPYING for more details. SEE ALSO
file(1) Jesse Kornblum v1.0 - 20 Feb 2008 MISSIDENTIFY(1)
All times are GMT -4. The time now is 12:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy