Search Results

Search: Posts Made By: rajeevm
1,267
Posted By rajeevm
Need to replace new line characters in a huge file
Hi ,

I would like to replace new line characters(\n) in a huge file of about 2 million records . I tried this one (:%s/\n//g) but it's hanging there and no result. Does this command do not work...
3,597
Posted By rajeevm
Hi RudiC, Its ls output . I need to list all...
Hi RudiC,

Its ls output . I need to list all the files in that directory and pick the latest file and get the datepart from that file. The filename can go like this abc_xyzmmyy.txt

Thanks
raj
3,597
Posted By rajeevm
Hi Franklin, Thanks for the quick reply but...
Hi Franklin,

Thanks for the quick reply but where do I need to put the filename , Could you please be more elaborative ?

Thanks
raj
3,597
Posted By rajeevm
Extract Date part from the filename
Hi All,

I have incoming source files abcmmyy.txt I need to extract the mmyy part from the filename and pass that to a variable . I really appreciate your quick response on this.

Thanks
raj
4,710
Posted By rajeevm
Hi All, I tried using awk one liner as...
Hi All,

I tried using awk one liner as below It worked fine for the first time when I ran it for the second time it did not

`cal |awk -v d="$(date +"%m %d %y")" 'BEGIN{split(d,a)} $0 ~...
4,710
Posted By rajeevm
Hi Corona I am using Korn shell script . It...
Hi Corona

I am using Korn shell script . It would be great if I can get using awk or sed

I tried using awk its not working

I really appreciate your help

Regards,
raj
4,710
Posted By rajeevm
Can we get Tuesday's date of the current week in UNIX
Hi All,

I have a requirement which would calculate the Tuesday's date of the current week in yyyymmdd format in unix shell script.

Please help me out how could I do this .

I appreciate your...
4,443
Posted By rajeevm
Hi Yoda, I tried using awk command but its...
Hi Yoda,

I tried using awk command but its just showing as 0 at unix command prompt but not appended to the file
awk 'NF{s = s ? s OFS $0 : $0; f = 1 }END{ if (f) print s; else print "0" }' OFS=,...
4,443
Posted By rajeevm
I wanted to do like this echo "0" >> sed command...
I wanted to do like this echo "0" >> sed command please let me know if this works and output file should have 0 in it. how do i do this approach

Regards,
raj
4,443
Posted By rajeevm
How to append a value to the output after using sed command?
Hi All,

I have a file where I am converting newlines to comma separated values but I would like to append zero if the output is empty

Here is the command I am using
sed -n -e...
2,768
Posted By rajeevm
How to rename bunch of files on sftp?
Hi All,

I am trying to move all processed .csv files on sftp to archive dir . I tried to use wildcard *.csv but its not working . Is there any way to do this. I appreciate your help.

Regards,...
45,569
Posted By rajeevm
I think grep is not working on sftp .Is there any...
I think grep is not working on sftp .Is there any other way to do this . Please help me out.

Regards,

Raj
45,569
Posted By rajeevm
Hi , Thanks for your replies. i tried...
Hi ,

Thanks for your replies. i tried Corona88's reply but that is not working. It says connecting to sftp but is not returning any values and not getting any files I need to get all the latest...
45,569
Posted By rajeevm
Find the latest file on remote sftp
Hi All,

I need your help in finding the latest files in remote sftp and get those files to local server and process them. Please let me know

I appreciate your valuable inputs.

Thanks
raj
2,429
Posted By rajeevm
Thanks Pamu .it worked. I appreciate your...
Thanks Pamu .it worked.

I appreciate your help


Regards,
Raj
2,429
Posted By rajeevm
Here is the sample data in file 2.txt ...
Here is the sample data in file 2.txt

123456789|100|1234567890|1|PE|NCY|bcdtxyz|xyzmail@ymail.com|I|2011-04-21|10008mktng59|10008z96n8d3|0BF51A46-68BD-4293-951D-DE08F6381C95|...
2,429
Posted By rajeevm
Hi Pamu, thanks for your reply. but the...
Hi Pamu,

thanks for your reply. but the delimiter in both the files are different file 1 has comma delimter and file 2 has | (pipe) delimiter , Do I need to change the code. please let me know...
2,429
Posted By rajeevm
Pamu, Somehow the code is not working. The...
Pamu,
Somehow the code is not working. The "common" file is not created and also the records which are written to "notinfile1" file can be found in the file 1 and the records which are written to...
2,429
Posted By rajeevm
I would like the output to the three different...
I would like the output to the three different files .Please let me know how could I do this. I really appreciate your help

Regards,
Raj

---------- Post updated at 12:50 PM ---------- Previous...
2,429
Posted By rajeevm
I have the two files as File1.txt Col1...
I have the two files as

File1.txt
Col1 Col2
1 aa
2 bb
3 dd
4 ee
5 ff

File2.txt
col1 col2 col3
11 aa 1
12 bb 3
13 cc 4


I have to compare...
2,429
Posted By rajeevm
I wanted to do equal to both the files with how...
I wanted to do equal to both the files with how many records are there in two files and how many records in file 1 but not in file 2 and how many records in file 2 but not in file 1 . delimited for...
2,429
Posted By rajeevm
Compare files
Hi,

I have a req which has two files comparing the first col in one file and last column in second file and write the results to an output file . How would I do this with awk command. Please help...
19,566
Posted By rajeevm
Thanks Pamu It worked. I appreciate...
Thanks Pamu

It worked.

I appreciate it.

Thanks
rajeevm
19,566
Posted By rajeevm
#!bin/sh #Param INPUT_FILE='abc.txt' ...
#!bin/sh
#Param
INPUT_FILE='abc.txt'

TOTAL_RECORDS=$(wc -l < $INPUT_FILE)

echo $TOTAL_RECORDS

REC_75=`awk -v VAR="$TOTAL_RECORDS" 'BEGIN {printf "%.0f",(VAR * 75 /100) }'`

echo...
19,566
Posted By rajeevm
And also I would like to write these 75 % and 25...
And also I would like to write these 75 % and 25 % records to two new files for that I did something like this
File75=`head -n $REC_75 $File > temp1.txt`

File25=`tail -n $REC_25 $File >temp2.txt`...
Showing results 1 to 25 of 28

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