Search Results

Search: Posts Made By: mora
6,274
Posted By mora
Thanks Ravinder for the quick reply, can you...
Thanks Ravinder for the quick reply, can you please tell me if we compress the file and send the file as attachemt can we unzip the file using winzip
6,274
Posted By mora
Check file size and mail
Hi,

I am trying to write a script which will check if the filesize is grather than 0 KB, compress the file and send to the email list else if the file size is zero KB don't send a mail update the...
2,321
Posted By mora
Thanks for the replies, now the script is working...
Thanks for the replies, now the script is working fine, please help to tell me how can I parametrize the script name and how can I dynamically pass all the sqls from a folder one by one to the main...
2,321
Posted By mora
SQL Report from UNIX
I am trying to write a shell script which dynamically reads all the .sql (oracle sql files) from a particular directory and generates a .csv file in the target directory.

I have started first with...
1,742
Posted By mora
Hi , Sorry for the confusion. Below is my...
Hi ,

Sorry for the confusion. Below is my sample source data and expected output.

Source Data

Data| 12345|U|76834|123
Xyz|123| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |...
1,742
Posted By mora
Replace Delimiters with Space
Hi All,
How to Replace the delimiter for a particular field. I have used awk to replace the field values based on the position, but I tried to remove/replace delimiters with space on particular...
1,901
Posted By mora
Hi Bakunin, Thanks for the help. I am new to...
Hi Bakunin,

Thanks for the help. I am new to unix so I was not sure if all can be done in one script. what I thought was if a table structure is generated then using some other script I can call...
1,901
Posted By mora
Sorry for the confusion, we are receving flat...
Sorry for the confusion, we are receving flat files in the below format

data1|xyxz|123
data1|xyxz|123|abc
data1|xyxz|123|abc|xyz

we need to count the maximum number of delimiters in the above...
1,901
Posted By mora
Generating Dynamic Scripts
Hi,

Please give me an idea on how to achieve the below using a unix script.

From our source team we are getting files with in-proper delimiters because of which our data load is failing to...
1,248
Posted By mora
Generating a Config File
HI,

I want to append some configuration statements to the existing file in unix to it's 3 line , 7th line and 28 line.

There is a file generated by our system job, to this I need to add some...
7,345
Posted By mora
Adding Filename as column using sed
Hi ,

Can any one please tell me, how can we add the file name as column using sed.
right now we are using the below awk command for adding the file name as column but when we are calling this...
1,055
Posted By mora
awk help
HI,

I have a .csv file , I am trying to remove the first column and load the remaining columns.

MY code.


awk 'BEGIN { FS=","; OFS="," } {$1="" , $0)}1' source.csv > target.csv


I am...
7,092
Posted By mora
Hi Yazu, I want to apply the logic,only if...
Hi Yazu,

I want to apply the logic,only if the first column is equal to RECORD,not for all the records in the file,how can I do this in sed.

--Mora
7,092
Posted By mora
HI Yazu, Thanks,simple and great solution. ...
HI Yazu,

Thanks,simple and great solution.

Can you please explain me the code as I don't know the sed I just want to know how this is stripping off the additional characters.

And if I want...
7,092
Posted By mora
Data Cleaning in a file
Hi ,

I have the below source data, I need to clean the data in 2nd,4th,5th columns.


Source Data
RECORD,CASH_TRANS,BEJING,AUG2011/CASH_TRANS,Y/N150/CASH_TRANS,N/201108...
2,250
Posted By mora
Removing columns using awk
HI ,

I have a comma delimiter file, in which I want to remove 8th and 9th column.

I tried removing those columns using the below code

awk 'BEGIN { FS=","; OFS="," }...
867
Posted By mora
Hi , I tried the below code removing the "<"...
Hi ,

I tried the below code removing the "<" from the filename, as below

find $SOURCE_FOLDER -name 'RUL*.csv' | while read FILENAME ;
do
awk -F, 'NR==1{print "RULE_NAME",$0;next}{print...
867
Posted By mora
awk help
Hey ,

I am trying to execute the below script

find $SOURCE_FOLDER -name 'RUL*.csv' | while read FILENAME ;
do
awk -F, 'NR==1{print "RULE_NAME",$0;next}{print FILENAME , $0}' OFS="," <...
18,092
Posted By mora
File Name as first column in the file
Hi ,

I have a .csv files in a folder, for all these files I am trying to add one column in the beginning that is the file name.

right now i have do it manually using the awk command

awk -f,...
1,246
Posted By mora
Checking the case of columns
Hi,

Is there a function in awk or sed which will check the case of the columns.

If my column 8 is in lower case then I want to change my column 10 data in lower case and vice versa.

I know...
961
Posted By mora
Multiple records based on :
Hi ,

I have the below source

source data
1|2|3|:123:abc|4
1|2|a| | 5
1|2|3|4|:a:s:D.....:n|t

Target data should be

1|2|3|:123:abc|4
1|2|3|:123:abc|4
1|2|a| | 5...
2,877
Posted By mora
Hey , I have tried the both the awk code,...
Hey ,

I have tried the both the awk code, the script is executing successfully but I am not getting the required out.source with param extension is getting copied.

--Mora
1,445
Posted By mora
Add text before extension
Hi ,

I have a txt file , in which there are multiple lines, I want to add .1cdb before each .txt file.

Source data

DB_SOURCE=DWHCBU
#Generate_file=/root/cbu/src/ET_CDR_SCAN.txt(# is a part...
2,877
Posted By mora
Split records based on '-'
HI,

I have a pipe delimiter file , I have to search for second field pattern, if the second field does not contain a '-' , I need to start capturing the record from this line till I find another...
1,050
Posted By mora
Thanks Ravi
Thanks Ravi
Showing results 1 to 25 of 32

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