Korne Script for format file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Korne Script for format file
# 36  
Old 02-25-2005
I would think the local is S:\ID_CARD, and the remote is /optim/db/results

CT
# 37  
Old 02-25-2005
Quote:
Originally Posted by CamTu
I would think the local is S:\ID_CARD, and the remote is /optim/db/results

CT
can you reconcile the above with the one below?

Quote:
Originally Posted by CamTu
Yes, i run this script from command line from the UNIX side.

The path (unix side) i want to ftp the file into is /optim/db/results
The path (window side) where the file are is S:\ID_CARD
think a bit more....
# 38  
Old 02-25-2005
hey vgersh99,

I got the automate fpt stuffs work now, but i used the software and wrote a script to run from that software on my window. Then the remote path is /optim/db/results and the local path is S:\\ID_CARD. I can set the script run in certain time interval i want to.

Can you put the output of the "comm" to the file?

CT
# 39  
Old 02-25-2005
Quote:
Originally Posted by CamTu
hey vgersh99,

I got the automate fpt stuffs work now, but i used the software and wrote a script to run from that software on my window. Then the remote path is /optim/db/results and the local path is S:\\ID_CARD. I can set the script run in certain time interval i want to.
glad you found A way.

Quote:
Originally Posted by CamTu
Can you put the output of the "comm" to the file?

CT
as with anything else - just redirect the output:

comm file1 file2 > fileWITHdiffs.txt
# 40  
Old 02-25-2005
I tried that but didn't seem to work.

this is the command i used:

comm -13 file1 file2 > easy.txt

However, it doesn't seem to give me the right results even with the "comn -13 file1 file2" command. It display some of the string that are in both file. And i test diff files, it gave me correct answer.

CT

Last edited by CamTu; 02-25-2005 at 05:38 PM..
# 41  
Old 02-25-2005
hey vgersh99,

Need your help againSmilie

Here is my data, if i only want it to print those line where the 6th argument is positive and the last argument is "Debit Charge"

Code:
000000000	Andrew	Clelland	200520	EASY	100	2/25/05 0:00	Debit Charge
000000001	Deanna	Coper 200520	EASY	-20	2/25/05 0:00	Payment for PTIC

How do i do it from this code:
Code:
#!/bin/awk -f

FNR==1{print "V2"} {_i=$3 ", " $2; _x=$6 "00"; printf("U%-19s%-39s%-130s%-178s%-41s%-6s\n", $1, _i, "01/01/10", "SCAD Group Inc.", "PA01001000100100PA01011010101101AD0100100", _x)}

Thanks

CT
# 42  
Old 02-25-2005
Quote:
Originally Posted by CamTu
I tried that but didn't seem to work.

this is the command i used:

comm -13 file1 file2 > easy.txt
works for me.
Quote:
Originally Posted by CamTu
However, it doesn't seem to give me the right results even with the "comn -13 file1 file2" command. It display some of the string that are in both file. And i test diff files, it gave me correct answer.

CT
Quote:
The comm utility will read file1 and file2, which should be
ordered in the current collating sequence, and produce three
text columns as output: lines only in file1; lines only in
file2; and lines in both files.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to generate Excel file or to SQL output data to Excel format/tabular format

Hi , i am generating some data by firing sql query with connecting to the database by my solaris box. The below one should be the header line of my excel ,here its coming in separate row. TO_CHAR(C. CURR_EMP_NO ---------- --------------- LST_NM... (6 Replies)
Discussion started by: dani1234
6 Replies

2. Shell Programming and Scripting

Conversion of below Tabs Tex file into CSV format file : shell script needed

Request if some one could provide me shell script that converts the below "input file" to "CSV format file" given Name Domain Contact Phone Email Location ----------------------- ------------------------------------------------ ------- ----- ---------------------------------... (7 Replies)
Discussion started by: sreenath1037
7 Replies

3. Shell Programming and Scripting

Converting windows format file to unix format using script

Hi, I am having couple of files which i used to copy from windows to Linux, so now in case of text files (CTRL^M) appears at end of line. I know i can convert this windows format file to unix format file by running dos2unix. My requirement here is that i want to do it automatically using a... (5 Replies)
Discussion started by: sarbjit
5 Replies

4. Shell Programming and Scripting

Finding modified File List after the chosen date in Korne Shell...

I am trying to write a Korne Shell asking the user for a date and a directory and then search recursively in this directory the list of files modified after the date chosen. But I am not getting good results when I Test it... #!/usr/bin/ksh echo "Enter a date (YYYYMMDD) " read date touch -t... (2 Replies)
Discussion started by: marconi
2 Replies

5. Shell Programming and Scripting

Korne Shell...

In Korne Shell Scripting, how to search recursively in a directory, the list of files modified after a given date .. Thanks in advance.. (1 Reply)
Discussion started by: marconi
1 Replies

6. Shell Programming and Scripting

Some Problem with Korne Shell//

I am new to Korne Shell Scripting. Can someone help me with a Korne Shell which asks the user :- 1) to enter the name of a file when searching it recursively (using the find command) in the home directory of this user. 2) for a date (format AAMMJJ) and a directory and then searches ... (4 Replies)
Discussion started by: marconi
4 Replies

7. Shell Programming and Scripting

Korne Shell Problem.

Hi Everyone, I have tried with the following Code for each of the following, but that does not seem to serve the purpose. Can someone give some pointers please. 1) A Korne Shell which asks the user to enter the name of a file when searching it recursively (using the find command) in the... (3 Replies)
Discussion started by: marconi
3 Replies

8. Shell Programming and Scripting

script for format a file

is there any way to format a file by just removing first line and last line from the file. my file is like test.txt 12may2004,20may2004,A 123,SCOTT,TIGER,,,,12,12-MAY-2006 124,TIGER,SCOTT,,,,,,, .... ... 163,cscssaa,abc,,,,12,12-MAY-2006 END my requirement is to produce the same file... (1 Reply)
Discussion started by: u263066
1 Replies

9. Shell Programming and Scripting

GOTO LOOP in KORNE SHELL

All Please help to provide "goto" functionality in KORN shell script. ex: 1: Command Process some command if check some variable true goto 1 else process some other Please help to implement this example in korne... (1 Reply)
Discussion started by: DeepakXavier
1 Replies

10. Shell Programming and Scripting

Mailing in Korne shell

All Iam using Korne shell in AIX OS. Can u give me the syntax to send a mail. Thanx in advance Regards Deepak (5 Replies)
Discussion started by: DeepakXavier
5 Replies
Login or Register to Ask a Question