Visit The New, Modern Unix Linux Community

Search Results

Search: Posts Made By: Jairaj
1,702
Posted By Jairaj
Extract values based on parameters passing in arguments
Based on arguments passing in command prompt values should fetch and store in new file.

Sample:-


sh test.sh 10 30 35 45

cat test.sh
..

cut -c $1-$2,$3-$4 file_name >> file_new
......
841
Posted By Jairaj
Is that something like below command you are...
Is that something like below command you are expecting ?

tr ' ' '\n' < File.txt
841
Posted By Jairaj
Provide required input and output to help you
Provide required input and output to help you
360
Posted By Jairaj
Try this sed 's/ //g' file1 >...
Try this

sed 's/ //g' file1 > output.file

--- Post updated at 05:47 AM ---

Try below :-

sed 's/ //g' file1 > output.file

tr -d ' ' <file1 > output.file


Please use CODE...
446
Posted By Jairaj
It's working.Thanks ! Can you tell me how...
It's working.Thanks !

Can you tell me how this statement(coomand) flow will work ?
446
Posted By Jairaj
It's working.Thanks ! Can you tell me how...
It's working.Thanks !

Can you tell me how this statement(coomand) flow will work ?
429
Posted By Jairaj
Split content based on keywords
I need to split the file contents with multiple rows based on patterns

Sample:
Input:
ABC101testXYZ102UKMNO1092testing
ABC999testKMNValid

Output:
ABC101test
XYZ102U
KMN1092testing...
446
Posted By Jairaj
Split content based on keywords
I need to split the file contents with multiple rows based on patterns

Sample:
Input:
ABC101testXYZ102UKMNO1092testing
ABC999testKMNValid

Output:
ABC101test
XYZ102U
KMN1092testing...
3,819
Posted By Jairaj
Find out values between xml tag
Find out values between xml tag

.......
ABC><name></ABC><xyz>test</xyz>..here some other tag... <ABC><NUMBER></ABC><xyz>12345</xyz>....
.......

I want to take between bewtween...
1,082
Posted By Jairaj
Try this: sort file10 > f1 sort file11 > f2...
Try this:
sort file10 > f1
sort file11 > f2
join f1 f2

Getting output :
2017917R 176606549.79 1766065498N
2068764R 295968115.42 2959681154N
2515401R 420124600.33 4201246003N
3514668R...
572
Posted By Jairaj
Try this : sort file | uniq
Try this :

sort file | uniq
1,141
Posted By Jairaj
Try this: awk '{sum+=$1} END {print sum}'...
Try this:

awk '{sum+=$1} END {print sum}' file
1,142
Posted By Jairaj
Try this : ls -ltr mylogfile.log | awk '{if...
Try this :

ls -ltr mylogfile.log | awk '{if ($5>5000) print $0}'

ls -ltr mylogfile.log | awk '$5>5000'
916
Posted By Jairaj
Try this : awk -F',"' '{print int($4)}' file ...
Try this :
awk -F',"' '{print int($4)}' file

---------- Post updated at 06:02 AM ---------- Previous update was at 06:01 AM ----------

Sorry about my previous command.

awk -F',"' '{ if...
2,698
Posted By Jairaj
you can use uname command and find the output for...
you can use uname command and find the output for which Os you are in.
3,665
Posted By Jairaj
Hi , Try the below command. find . -type f...
Hi , Try the below command.

find . -type f -exec grep <string> /dev/null {} \;
1,242
Posted By Jairaj
Thanks Scrutinizer & tyler_durden. Scrut, It...
Thanks Scrutinizer & tyler_durden.

Scrut, It will be great if you explain how it is working.
1,242
Posted By Jairaj
hi Kamaraj, I am getting the below error...
hi Kamaraj,

I am getting the below error mesg:

test.sh[6]: read: A specified flag is not valid for this command.
1,242
Posted By Jairaj
Thanks. This is working fine. But values will be...
Thanks. This is working fine. But values will be dynamic.

sample input:

a~b~c~value in ('3','4','5')~test2
x~y~val~value in ('0','1','2')~test2

after third delimiter values should be...
1,242
Posted By Jairaj
split content and write to new record
Hi,

Help required to split record value and write to new row.

Input
a~b~c~value in ('3','4','5')~test

output
a~b~c~3~test
a~b~c~4~test
a~b~c~5~test

input
a~b~c~value in...
14,684
Posted By Jairaj
Hi Agrawal, Please explain how the above...
Hi Agrawal,

Please explain how the above awk command works.
1,232
Posted By Jairaj
Thanks Ahmed & Danmero, Both your commands...
Thanks Ahmed & Danmero,

Both your commands are working.

for sample I given below calculation in 5th field
awk '{if (NF==3) {print $2$3} else if (NF==2) {print $2}}'

But I wanted to do...
1,189
Posted By Jairaj
Try this:- sed -n '/#START/,/#END/p' file |...
Try this:-

sed -n '/#START/,/#END/p' file | grep -v '#START' | sed 's/#END//g'
2,664
Posted By Jairaj
Try this: tr -d "'" <file ----------...
Try this:

tr -d "'" <file

---------- Post updated at 08:51 AM ---------- Previous update was at 08:40 AM ----------

Hi Scottn,

Previously, I tried using sed but with single quote , it...
1,189
Posted By Jairaj
Try this: sed -n '/#START/,/#END/p' file |...
Try this:

sed -n '/#START/,/#END/p' file | grep -v '#START' |grep -v '#END'

If not, provide expecting output file.
Showing results 1 to 25 of 128

 

Featured Tech Videos

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