working with files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting working with files
# 1  
Old 07-17-2007
PHP working with files

Hi All,

Can u plz tell me how to ensure row count.


input file /app/PNYCOINF01/opera/operaprd/Data/SENTRY_BSL2_COLLRECEIVEPOS_AM_20070716.dat
checkFile: The input file exists
checkFile: Checking for existing copy of output file /app/PNYCOINF01/opera/operaprd/SrcFiles/AMS/SENTRY_BSL2_COLLRECEIVEPOS_AM_20070716.dat
checkFile: There are no existing copies of the output file
checkFile: Checking the first 1 lines of the file for "20070716"
checkFile: Passed the header check
checkFile: Checking the line count appears in the footer
checkFile: The total number of rows of data in the file is 631
checkFile: Checking 631 appears in the 1 lines of the footer
checkFile: Failed to find the correct row count in the file.
checkFile: EXITING DUE TO ERRORS Mon Jul 16 23:37:02 EDT 2007


What i checked is

wc -l SENTRY_BSL2_COLLRECEIVEPOS_AM_20070716.dat
632

opened the file checked the last line which was footer it is currently showing 630 as count. It may be, after some change taken place in file by our manager, i just wanted to understand what was the change took place.

i am thinking that either deletion or addition of one emptyline into file may be done. if it is true, where did he add or delete it if not can u plz advise me for further.


thanks in advance..
-bali
# 2  
Old 07-17-2007
PHP working with files---rowcount issue

Hi All,

Can u plz tell me how to ensure row count.


input file /app/PNYCOINF01/opera/operaprd/Data/SENTRY_BSL2_COLLRECEIVEPOS_AM_20070716.dat
checkFile: The input file exists
checkFile: Checking for existing copy of output file /app/PNYCOINF01/opera/operaprd/SrcFiles/AMS/SENTRY_BSL2_COLLRECEIVEPOS_AM_20070716.dat
checkFile: There are no existing copies of the output file
checkFile: Checking the first 1 lines of the file for "20070716"
checkFile: Passed the header check
checkFile: Checking the line count appears in the footer
checkFile: The total number of rows of data in the file is 631
checkFile: Checking 631 appears in the 1 lines of the footer
checkFile: Failed to find the correct row count in the file.
checkFile: EXITING DUE TO ERRORS Mon Jul 16 23:37:02 EDT 2007


What i checked is

wc -l SENTRY_BSL2_COLLRECEIVEPOS_AM_20070716.dat
632

opened the file checked the last line which was footer it is currently showing 630 as count. It may be, after some change taken place in file by our manager, i just wanted to understand what was the change took place.

i am thinking that either deletion or addition of one emptyline into file may be done. if it is true, where did he add or delete it if not can u plz advise me for further.


thanks in advance..
-bali
# 3  
Old 07-17-2007
There are duplicate threads being opened for the same problem, i would request you to adhere to the Forum Rules.
# 4  
Old 07-17-2007
Do not bump up posts if they are not promptly answered.

wc -l for the file shows 632
and the trailer record inside the file shows as 630.
Application might have written only the count of detailed records which actually evaluates to 632 - 2 ( header + trailer ) = 630

Could you please check that ?
# 5  
Old 07-17-2007
PHP working with files ---row count

Hi
i am sorry for dumping twice as i have some proble with IE. sorry i don't repeat it.

the logic which u told is currect, i found footer with 639 as count, but when i checked with wc -l file resulting 642. what is the modification can we do with out affecting data inside the file.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Apache chown on its files not working

Hello, My apache user generate one file : # ls -lsa /tmp/reference_file.csv 76 -rwxrwxrwx 1 apache apache 69921 Aug 16 14:14 tmp/reference_file.csv the user and the group belong to apache, but when i am trying to change it : su -l apache -s /bin/bash -bash-3.00$ whoami apache... (7 Replies)
Discussion started by: cterra
7 Replies

2. Shell Programming and Scripting

Output, working with files. What is wrong?

I cannot figure out what is wrong.... I have 3 files with IP addresses: file1 134.123.3.236 file2 134.123.3.235 file3 134.123.5.237 I type "prob1 Oops x2x3x4". Then my code creates file with name Oops and first line x2x3x4. Moreover, my code generate IP and it gives to file Oops as a second... (8 Replies)
Discussion started by: Manu1234567
8 Replies

3. Shell Programming and Scripting

Working with files that are named with a timestamp

So I have a script that runs an ls on a given directory and looks for files with a timestamp that has the current hour in it and then does work with the files that it discovers DATE=`date +'%y%m%d%H'` HOSTIS=`hostname` #EMAIL NOTIFICATION ALS EMAIL=address@server.com # if ; then ... (5 Replies)
Discussion started by: os2mac
5 Replies

4. Shell Programming and Scripting

[awk] working with two files

Hello guys, I have little to no experience working with two files in awk and hope you can help me with a problem that may be easy for you to solve... awk -v cut1="$var1" -v cut2="$var2" '{split($0, arr1); for(i=1;i<=NF;i++) if (arr1 < cut1) print arr1, NR, i}' file1 file2 The above code is... (4 Replies)
Discussion started by: origamisven
4 Replies

5. Shell Programming and Scripting

Problem while working with multiple files

Dear friends, I am working with two files named g1.txt and g2.txt....g1.txt is my main file in which it contains following data #per_no permissionname permission command 1|HideCDrive, | : REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v... (1 Reply)
Discussion started by: jalpasoni
1 Replies

6. Shell Programming and Scripting

Working on Files

Hi, One of the program creating a file with the following information. $cat a.txt 1, AAA, 234 $ and I wrote a script whenever any of the the file exists with data then it will send a email to me. If I start the job second time, then the as per the logic it is sending the same data, I... (3 Replies)
Discussion started by: Alex_Smith
3 Replies

7. Shell Programming and Scripting

Working with log files

I wrote a bash script to extract a few Items like the IP addresses that makes the most number of connection attempts, now I want to limit all of this within a time range , lets say the last X days/hours. Example of what I wrote : -G: Which IP address makes the most number of connection... (2 Replies)
Discussion started by: melisa.zand
2 Replies

8. AIX

exclude files not working

HI, I have upgraded nim master and client to TL8,SP6. Now when the mksysb backup ran from master,it is not excluding directories specified in /etc/exclude.rootvg in the client.Instead,mksysb is getting created for all the file systems in the rootvg. This problem only appeared after the TL... (3 Replies)
Discussion started by: to_bsr
3 Replies

9. UNIX for Dummies Questions & Answers

RedirectMatch not working for files

Hi I am trying to redirect all webpages within a directory on my site to another website. I can only get this to work for directories only, not actual files. The following scenarios work: http://www.mysite.com/folder1/folder3 redirects to http://www.newsite.com/redirectpage.jsp ... (0 Replies)
Discussion started by: geoscience
0 Replies

10. Shell Programming and Scripting

bash script working for small size files but not for big size files.

Hi, I have one file stat. Stat file contents are as follows: for example. H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000 H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000 Now i... (1 Reply)
Discussion started by: davidpreml
1 Replies
Login or Register to Ask a Question