Search Results

Search: Posts Made By: Saanvi1
1,687
Posted By Saanvi1
Converting String Date into UNIX Date
Hi,
I have a string date to my unix script(sun solaris). I wanted to convert it into unix date so that I can use it in a conditional statement. Please see below:


MyTest.sh -s 2018-05-09
...
6,108
Posted By Saanvi1
Tried it but did not work
I tried this as suggested in the code below. This works fine for filenames with no spaces but does not work for filenames that spaces. I have pasted the code I tried and output below:


{
read...
6,108
Posted By Saanvi1
How to list and move files with spaces and wildcard?
I am writing a code that can move and archve all the files in a directory except the latest file based on file pattern provided in a controlfile.
The filename is in the form of pattern. So basically...
1,536
Posted By Saanvi1
Thanks a bunch. This was very helpful. ...
Thanks a bunch. This was very helpful.

....Saanvi
1,536
Posted By Saanvi1
Compare files to pull changed records only
Hi,
I am using Sun Solaris - SunOS. I have two fixed width files shown below. I am trying to find the changes in the records in the Newfile.txt for the records where the key column matches. The...
4,731
Posted By Saanvi1
{ head -1 ; head -n-1 | sort -t"|" -k2,3; } <...
{ head -1 ; head -n-1 | sort -t"|" -k2,3; } < Test1.txt

Thanks for the reply. But the code is not working. Getting the error below:

head: Invalid "-n -1" option
usage: head [-n #] [-#]...
4,731
Posted By Saanvi1
Sort without Header and Trailer
Hi ,
My UNIX system is SUN Solaris.
I am trying to do a simple thing as described below.
I have a PIPE delimited file that has header and trailer. So the file is something like below:
...
3,806
Posted By Saanvi1
Thank you Don and RudiC for your help/advice....
Thank you Don and RudiC for your help/advice. Appreciate your time.
I was able to run both the code suggested by RudiC using nawk and /usr/xpg4/bin/awk.

The split is working fine. But getting...
3,806
Posted By Saanvi1
Thank you for the response. I tried the code...
Thank you for the response. I tried the code below:
{
{ readlink /proc/$$/fd/0; line; sort; } | awk '
NR==1 {OF=$0
next
...
3,806
Posted By Saanvi1
Sort and Split file with header and custom name
Hi,

I am using SUN SOLARIS (SunOS sun4v sparc SUNW, T5240).
I have a huge data file with header and trailer. This file gets used into an ETL process. ETL skips the header record (which is...
2,599
Posted By Saanvi1
Unfortunately I do not have stat. Would we...
Unfortunately I do not have stat.

Would we be able to use ls -Eu and grab the date.

Thanks
2,599
Posted By Saanvi1
Thank you Vgersh99 for the reply. It is working...
Thank you Vgersh99 for the reply.
It is working fine. The only thing I need in this "need a create file date here" to be replaced by that file creation date on unix system in YYYYMMDD format.

ls...
2,599
Posted By Saanvi1
Thank you RudiC for the response. I tried the...
Thank you RudiC for the response. I tried the suggested code but getting the error message below. Also, "la" is not a recognizable command hence changed it to "ls -1". I am using Sun Solaris. Sorry...
2,599
Posted By Saanvi1
Replacing Date in the file with Create date and timestamp
Hello,
I have files that with a naming convention as shown below. Some of the files have dates in the file name and some of them don't have dates in the file name.


imap-hp-import-20150917.txt...
1,713
Posted By Saanvi1
Thanks Scrutinizer. Let me try that out ...
Thanks Scrutinizer. Let me try that out

---------- Post updated at 03:22 PM ---------- Previous update was at 03:12 PM ----------

Hi,
I tried the script below:


#!/bin/ksh
ls...
1,713
Posted By Saanvi1
It is one of the ETL servers that loads these...
It is one of the ETL servers that loads these files into databases. Each file pertains to different load process. So passing filename in parrallel will load various tables based on filename...
1,685
Posted By Saanvi1
Thanks Corona for the response. Will the above...
Thanks Corona for the response. Will the above fix will work if the variable are not one below the other. I am sorry if it was not clear in my post. The file contains more than 50 variables. I want...
1,713
Posted By Saanvi1
Script2.sh actually kicks off external software...
Script2.sh actually kicks off external software that identifies the process based on the first part of the filename passed before date.

For example:
app-mobility-imp will kick off the...
1,685
Posted By Saanvi1
Updating variables using sed or awk
Hi,
I have a file(testfile.txt) that contains list of variables as shown below. T

$$FirstName=James
$$LastName=Fox
$$Dateofbirth=1980-02-04
……and so on there are 50 different variables.

I...
1,713
Posted By Saanvi1
Picking up files conditionally
Hi
I have a scenario:
I have a directory say DIR1 (no sub directories) and have few files in that directory as given below:

app-cnd-imp-20150820.txt
app-cxyzm-imp-20150820.txt...
2,934
Posted By Saanvi1
Thanks a ton. This is working fine and as...
Thanks a ton. This is working fine and as expected.

All the files in the given directory are zipping fine.

Thanks...This is very helpful.

---------- Post updated at 11:41 AM ----------...
2,934
Posted By Saanvi1
Thanks for the response. I just need to zip...
Thanks for the response. I just need to zip certain txt files in a one particular directory and do not have to do any search or zip the files in the subdirectories at all. The files are generated by...
2,934
Posted By Saanvi1
Grabing the same timestamp from files that are ZIPPED
Hi,

I am zipping more than 20 files that has same timestamp in all of them. I need to create the zip file with the same timestamp as in the files that are zipped.

So I have files:...
1,535
Posted By Saanvi1
Thank you so much....the code below is working...
Thank you so much....the code below is working perfectly now.

nawk 'NR==FNR{A[$1];next}!($1 in A)' ${pfile} ${cfile} > NewRec.txt
nawk 'NR==FNR{A[$1];next}!($1 in A)' ${cfile} ${pfile} >...
1,535
Posted By Saanvi1
Thanks for suggestion. I tried the suggested code...
Thanks for suggestion. I tried the suggested code but somehow getting the error


Below is the code I tried:

#!/bin/ksh

pfile=oldfile.txt
cfile=currentfile.txt

awk...
Showing results 1 to 25 of 33

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