Hi,
I need some help in removing the header (first line) and the trailer (last line) in a give file...
The data file actually comes in EBCDIC format and I converted it into ASCII..
Now I need to strip off the first line and the last line..
I think we can use sed to do something like this:... (2 Replies)
Situation:
Our system currently executes a job (COBOL Program) that generates an interface file to be sent to one of our vendors. Because this system processes information for over 100,000 employees/retirees (and growing), we'd like to multi-thread the job into processing-groups in order to... (4 Replies)
Hi All,
In my file i need to remove header and trailer records which comes in 1st line and last line respectively. After that i need to replace '$\|' with '$#@'.
I am using sed command for this and its taking lot of time. Is there any other command which can be used to improve performance?
... (1 Reply)
Hi All,
PFB is a requirement. I am new to shell scripting. So plz help. It would be highly appreciated.
1. choose all the log files based on a particular date (files location is '/test/domain')--i.e,we should choose all the files that are modified on 29th November, neither 28th nor 30th
2.... (3 Replies)
Hi,
I want to add the below Header to all the files in sequence File1,File2,File3...etc
"ABC,<number of chracter in the file>"
e,g - If File1 is as below
pqrstuvdt
abcdefgh
then I want to add the above header into it ,So that File1 becomes as below
ABC,17
pqrstuvdt
abcdefgh
... (9 Replies)
Hi All,
I am trying write a simple command using AWK and SED to this but without any success.
Here is what I am using:
head -1 test1.txt>test2.txt|sed '1d;$d' test1.txt|awk '{print substr($0,0,(length($0)-2))}' >>test2.txt|tail -1 test1.txt>>test2.txt
Input:
Header
1234567
abcdefgh... (2 Replies)
Hi,
I need a script that validates a file header/detail/trailer. File layout is:
Header - Rec_Type|File_name|File_Date
Detail - Rec_Type|field1|field2|field3...
Trailder - Rec_Type|File_name|File_Date|Record_count
Sample Data:
HDR|customer_data.dat|20120709... (7 Replies)
Hi Experts
Need help...
I am looking for a Unix script to append pipe | at the end of all the rows (except header and trailer)in all the files placed under the directory /interfaces/Temp
e.g.
Header
row1
row2
row3
Trailer
The script should read all the files under... (3 Replies)
Discussion started by: phani333
3 Replies
LEARN ABOUT ULTRIX
cp
cp(1) General Commands Manual cp(1)Name
cp - copy file data
Syntax
cp [ -f ] [ -i ] [ -p ] file1 file2
cp [ -f ] [ -i ] [ -p ] [ -r ] file... directory
cp [ -f ] [ -i ] [ -p ] [ -r ] directory... directory
Description
The command copies file1 onto file2. The mode and owner of file2 are preserved if it already existed; the mode of file1 is used otherwise.
Note that the command will not copy a file onto itself.
In the second form, one or more files are copied into the directory with their original file names.
In the third form, one or more source directories are copied into the destination directory with their original file names.
Options-f Forces existing destination pathnames to be removed before copying, without prompting for confirmation. The -i option is ignored if
the -f option is specified.
-i Prompts user with the name of file whenever the copy will cause an old file to be overwritten. A yes answer will cause to continue.
Any other answer will prevent it from overwriting the file.
-p Preserves (duplicates) in the copies the modification time, access time, file mode, user ID, and group ID as allowed by the permis-
sions of the source files, ignoring the present umask.
-r Copies directories. Entire directory trees, including their subtrees and the individual files they contain, are copied to the speci-
fied destination directory. The directory, its subtrees, and the individual files retain their original names. For example, to copy
the directory including all of its subtrees and files, into the directory enter the following command:
cp -r reports news
See Alsocat(1), pr(1), mv(1)cp(1)