Search Results

Search: Posts Made By: techedipro
2,542
Posted By techedipro
@Dan, The requirements have not changed ,...
@Dan,

The requirements have not changed , the script that i coded was impromptu and may not satisfy the requirements

I have made a minor update to the code that RudiC gave on post #6 to pass...
2,542
Posted By techedipro
@Don Here is the working script I have , can...
@Don

Here is the working script I have , can you please improvise it and make it more efficient

#!/usr/bin/ksh

# Get header Record

grep '^0' Source.txt |head -1 > Output.txt

# Get...
2,542
Posted By techedipro
@ RudiC I want to run the AWK command...
@ RudiC

I want to run the AWK command through a script by passing input file name as a parameter to the script as Each run will have a different input file.

The header and trailer should be in...
2,542
Posted By techedipro
@ RudiC. How can I pass the source file as a...
@ RudiC.

How can I pass the source file as a parameter to the script ?

Also can you please explain the code ?

Header and Trailers need to copied over to the file that has "R" at position 75....
2,542
Posted By techedipro
@ jim mcnamara There is some syntax error on...
@ jim mcnamara

There is some syntax error on the command, can you check if it is missing a '
2,542
Posted By techedipro
Split by Position
I am on AIX.

I need to use AWK to split the source file based on a character at a certain position.

Position 75 with a value of 'R' should go in one output file and the rest should go in...
1,376
Posted By techedipro
Thannks RudiC
Thannks RudiC
1,376
Posted By techedipro
RudiC - Thanks Can we make the position as a...
RudiC - Thanks

Can we make the position as a varaiable as well ? substr ($0, 31, 3) ?

Also greatly appreciate if can you explain how the script works.

Thanks in Advance
1,376
Posted By techedipro
RudiC Script should have the below...
RudiC

Script should have the below parameters/variables

Input File Name
Record Type
Position
Header
Trailer
1,376
Posted By techedipro
Conditional Split
Greetings,

I need help in splitting the files in an efficient way while accommodating the below requirements . I am on AIX.

Split condition

Split the file based on the record type and the...
734
Posted By techedipro
RudiC & rbatte1 Thanks for your valuable...
RudiC & rbatte1

Thanks for your valuable inputs.

version : Version M-11/16/88f

I have made minor change to the pattern as well as corrected the typo on the output file and also included...
734
Posted By techedipro
Pattern Match FileNames
I am on AIX.

I need to list the contents of the directory based on a pattern and write an XML output file with file names.

If a filename does NOT match the below pattern then write an OUTPUT...
5,555
Posted By techedipro
That is a detailed explanation...Thanks Dan!
That is a detailed explanation...Thanks Dan!
5,555
Posted By techedipro
Thanks Don. Can you please explain me in...
Thanks Don.

Can you please explain me in detail as to how the code works.
5,555
Posted By techedipro
@RudiC Correct. It worked. One last...
@RudiC

Correct. It worked.

One last piece of puzzle is how can I parameterize the number of records (In my current code it is "3") in the script.



#!/usr/bin/ksh
File1=$1
awk...
5,555
Posted By techedipro
To further extend this..how can i run the awk...
To further extend this..how can i run the awk command in the Korn shell by passing the input file name as a paramter to the script.


#!/usr/bin/ksh
File1=$1
awk...
5,555
Posted By techedipro
I am on AIX 7100-03 I tried splitting the...
I am on AIX 7100-03

I tried splitting the input file using awk and I am still stuck in passing the input file name as variable

awk 'NR%3==1{x=sprintf("%03d_Test",++i);}{print > x}' abc.txt
...
5,555
Posted By techedipro
Understood..Going forward I will provide enough...
Understood..Going forward I will provide enough information about the environment.
5,555
Posted By techedipro
RudiC & apmcd47, Initailly I did not tested...
RudiC & apmcd47,

Initailly I did not tested the command with -d flag . I realized it only after running it on AIX machine that -d is not an option.

-d flag will not work.

Any other work...
5,555
Posted By techedipro
I am on AIX 7100-03 I am getting an error on...
I am on AIX 7100-03

I am getting an error on the -d flag


admin@tst(/script)$ split -l 3 -a 1 -d abc.txt F
split: Not a recognized flag: d
Usage: split [-l Line_Count] [-a Suffix_Length]...
5,555
Posted By techedipro
Split and Rename Split Files
Hello,

I need to split a file by number of records and rename each split file with actual filename pre-pended with 3 digit split number.

What I have tried is the below command with 2 digit...
1,556
Posted By techedipro
Copy down based on condition
Hello:

I need to copy down some data from the previous record in to the next record based on the below conditions

If position 41- 59 of the current record is same as the previous record and the...
11,104
Posted By techedipro
Thanks Chubler!! If I were to use the sed +...
Thanks Chubler!!

If I were to use the sed + tr combo , how can I loop through a set of characters which are stored in a file and then perform replace recursively on the input file ?

Probably a...
11,104
Posted By techedipro
Thanks Chubler ! I do not have gawk on my...
Thanks Chubler !

I do not have gawk on my machine , is there any other way we can accomplish the task ?

Also is there a way of retrieving what characters were replaced and how many times were...
11,104
Posted By techedipro
One more change ,I need to replace a bunch of...
One more change ,I need to replace a bunch of special characters on the input file while I am splitting it

Below is the list that I need to find and then replace with the corresponding value
...
Showing results 1 to 25 of 42

 
All times are GMT -4. The time now is 01:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy