Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: Pratik4891
595
Posted By Pratik4891
Replace variable value in first file based on records in second
Hello ,

I have below files
a) File A

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<root xmlns="http://aaa/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema" version="2.0">
...
724
Posted By Pratik4891
Replace variable number of character
hi All,

My requirement is to replace variable number of in between character with X



The first 6 and last 4 characters will remain same and rest characters will be masked with X

Example -...
6,480
Posted By Pratik4891
Mysql output to file
Hi,

Below is my code to execute mysql statement , how to save the output to a file ?

#!/usr/bin/bash

#Script to run automated sql queries

#Declaring mysql DB connection
...
561
Posted By Pratik4891
Copy filepath along with filename at end of another file
Hi ,

Please help me out for the below problem -

I have 2 files in a directory -

$ ls -ltr
total 4
-rwx------+ 1 abc Domain Users 615 May 31 17:33 abc.txt
-rwx------+ 1 abc Domain Users ...
2,206
Posted By Pratik4891
Done below - #!/bin/sh while read...
Done below -


#!/bin/sh

while read line
do
if echo $line | grep source; then
line_no=`echo $line | sed 's/source\([0-9]*\)/\1/g'`
elif echo $line | grep END; then
:...
2,206
Posted By Pratik4891
Create multiple files from single file based on row separator
Hello ,

Can anyone please help me to solve the below -

Input.txt

source table abc
col1 char
col2 number
source table bcd
col1 date
col2 char


output should be 2 files based on the...
751
Posted By Pratik4891
Adding a column
Hello ,

My requirement is to add additional column sequentially to a text file based on the column value -

i/p file

id1|varchar
id2|varchar
id3|number
id4|number
id5|date
id6|date...
1,352
Posted By Pratik4891
Thanks ,it worked
Thanks ,it worked
1,352
Posted By Pratik4891
Sorry its not working I have ran the code in...
Sorry its not working

I have ran the code in an environment where the sFTP connection is not set up and it didnt ftped the file although the file is archived
1,352
Posted By Pratik4891
SFTP file and archive only if its succedded
Hi All,

I have a requirement where I have to archive the file as soon as I sFTP the file to remote location

below is the code I am going with

ls $FILE_NAME | while read FNAME
do
sftp -v...
2,193
Posted By Pratik4891
Thanks Don The current source directory is...
Thanks Don

The current source directory is under owner zthm02m

which also belongs to azthetlw

Do you think still thats the reason ?

$ id zthm02m
uid=37896(zthm02m) gid=8894(w6azth)...
2,193
Posted By Pratik4891
AIX rsu4 1 6 00F736154C00 id which is trying...
AIX rsu4 1 6 00F736154C00

id which is trying to move the file is xiam12m

id xiam12m


uid=36248(xiam12m) gid=7602(wecxia) groups=azthetlw
2,193
Posted By Pratik4891
@Don Please find the command result ...
@Don

Please find the command result



drwxrwsrwx 2 zthm02m azthetlw dir_to_be_copied
drwxr-xr-x 2 zthm02m azthetlw source_dir
-rw-rw-r-- 1 ztheud0 wzthetl filename
...
2,193
Posted By Pratik4891
MV file with other permission
Hello All

I have a file with rw-rw-r permission

I need to mv the file into different directory (dir has rwx-rwx-rwx permission)
with an others permission

The application which is moving...
1,322
Posted By Pratik4891
Filename check in UNIX
Hello ,

I have to search for the file names which will either has ABC_DEF or NN in their filename

Please note that both cannot appear in the same file name

currently I am using

ls -lrt...
2,811
Posted By Pratik4891
Thanks a lot however I am getting the below error...
Thanks a lot however I am getting the below error

awk: A print or getline function must have a file name.

I have blank lines in file

Please let me know how to overcome that
2,811
Posted By Pratik4891
awk getline function help
Hello All ,

I have to split a file as well as keep the header in all the splitted files.

For this I am using the getline function of awk to keep the header however the catch is header is of 4...
5,090
Posted By Pratik4891
Thanks a lot for all the responses ,surely a new...
Thanks a lot for all the responses ,surely a new learning for me .

However the output is created one record per file and my requirement is to keep 2 records in each file and each record will be...
5,090
Posted By Pratik4891
The script suppose to split the main file such a...
The script suppose to split the main file such a way every file have two records

---------- Post updated at 10:57 AM ---------- Previous update was at 10:46 AM ----------

Thanks Yoda,could you...
5,090
Posted By Pratik4891
Split file based on number of blank lines
Hello All ,

I have a file which needs to split based on the blank lines

Name ABC
Address London
Age 32
(4 blank new line)



Name DEF
Address London
Age 30
(4 blank new line)


...
827
Posted By Pratik4891
Override last line in UNIX
Hello ,

I have to override the last line of a text file in unix
I know one way is to delete and insert however I am looking for a one liner.

Could anyone help me to write it?

below is the...
1,109
Posted By Pratik4891
Putting $$ before filename
Hello ,

I am searching a directory for a file and have to assign the filename to a variable .
The variable must have form $$filename

So my code is

echo "'$$filename='`ls -lrt...
1,168
Posted By Pratik4891
Merge different files into the original file
Hello

Below is my requirement

I have 3 files A1.txt , A2.txt and A3.txt . A2 is dynamically generating file

I want the merge of A1,A2 and A3 in A2.txt

Could you please help?
4,693
Posted By Pratik4891
Thanks Akash , However I am getting the...
Thanks Akash ,

However I am getting the below error

awk: A print or getline function must have a file name.
The input line number is 1. The file is HSBC_new.xml.
The source line number is 1.
4,693
Posted By Pratik4891
Split XML file based on tags
Hello All ,

Please help me with below requirement

I want to split a xml file based on tag.here is the file format

<data-set>
some-information
</data-set>
<data-set1>
some-information...
Showing results 1 to 25 of 157

 

Featured Tech Videos

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