Search Results

Search: Posts Made By: FelipeAd
1,337
Posted By FelipeAd
Thanks. It works, although if the initial data...
Thanks. It works, although if the initial data actually begins with 0, it replaces it with -1 which is not desired. The rest works great though

---------- Post updated at 04:02 AM ----------...
1,337
Posted By FelipeAd
Replace groups into sequential numbers
I have a file that looks like this:

n1 1
n2 1
n3 1
n4 3
n4 3
n2 5
n2 5
n2 5
n2 5
n3 5
n3 5
n4 6
n7 6

that is a name followed be a descriptive number.
I want to make these numbers...
1,306
Posted By FelipeAd
Grep with special chars line by line
I have a file that includes strings with special characters, eg
file1

line:[] 1 - special 1
line: = 4
line; -3
etc

How can I grep the lines of file1 from file2, line by line?

I used...
1,211
Posted By FelipeAd
Thank you. That seems to work in most cases,...
Thank you.
That seems to work in most cases, although not when -i is used in grep.
But this solved my problem, so thanks.
1,211
Posted By FelipeAd
I want to use keyword to grep in another file. ...
I want to use keyword to grep in another file.
But the keyword can also be a phrase eg I want to grep the whole phrase "today is" from the next file.
1,211
Posted By FelipeAd
Input for read command
Hello,

I want to use the read command in order to input a keyword from the keyboard.
I then want to use this keyword in a grep command.
How to I input a phrase as a keyword? For example if I...
1,591
Posted By FelipeAd
It works. Thanks really a lot
It works.

Thanks really a lot
1,591
Posted By FelipeAd
Sorry, misunderstanding. I only want to keep...
Sorry, misunderstanding.
I only want to keep the blocks for which the first line contain "size 'number' " where number >200.

But the number of rows for each block could also be less than 200
1,591
Posted By FelipeAd
No, the size of the blocks does not match the...
No, the size of the blocks does not match the parameter "size". What I want is to delete the block of data from one $ to the next, IF the parameter "size" is >200
1,591
Posted By FelipeAd
Delete several lines if the first line contain numbers > 200
I have a file of the following format:


$data1 size 1278
dataw
datat
datau
datai
$data2 size 456
datak
dataf
datat
datay
datal
$data3 size 154
datag
datas
datat
datar
datas
1,945
Posted By FelipeAd
Sorry bakunin, I am not sure i understood what...
Sorry bakunin, I am not sure i understood what you said.
I found from a previous thread

https://www.unix.com/shell-programming-scripting/121566-averaging-multiple-columns.htmlthat in order to...
1,945
Posted By FelipeAd
I started by using sort command, in particular ...
I started by using sort command, in particular

sort -d -k1,1 file

to find those lines that are repeated but then i am not sure how to distinguish between the lines with the same name after that
1,945
Posted By FelipeAd
Find the average based on similar names in the first column
I have a table, say this:

name1 num1 num2 num3 num4
name2 num5 num6 num7 num8
name3 num1 num3 num4 num9
name2 num8 num9 num1 num2
name2 num4 num5 num6 num4
name4 num4 num5 num7 num8...
1,924
Posted By FelipeAd
Do you know how to modify your first solution if...
Do you know how to modify your first solution if file2 has more columns?
1,924
Posted By FelipeAd
Thanks! The first code works great, the second...
Thanks! The first code works great, the second works only in sorted files but it seems quick and useful anyways
1,924
Posted By FelipeAd
Grep if the name exists, otherwie leave blank
I have two files,
file1:

name1
name2
name3
name4
name5
name6file2

name1 group1
name3 group2
name4 group3
name6 group4
name9 group5
name10 group6
name11 group7
name12I need a code...
2,202
Posted By FelipeAd
Thank you all for your replies. rangarasan,...
Thank you all for your replies.

rangarasan, you are right, "name" is a dynamic value. In fact I have multiple 'title' files and a file with a list of 'names'. My actual code would be to read each...
2,202
Posted By FelipeAd
I have a file in the form: title1: title2:...
I have a file in the form:

title1:
title2:
title3:
title4:


I want to paste the string "name" after title2. That will be:

title1
title2: name
title3
title4
2,202
Posted By FelipeAd
Paste a string after another string in file
Hello,
how can I paste a string1 after a particular string2 in a file?
731
Posted By FelipeAd
Replacement in certain tags of a file from another file
Here is the situation. I have a number of files with certain tags (TAG files):


TAG1:
TAG2:
TAG3:
TAG4:
TAG5:
TAG6:
TAG7:
and another file with the following format:

//name1
Jason...
3,418
Posted By FelipeAd
Thank you for your replies, ahamed and methyl...
Thank you for your replies, ahamed and methyl here are some sample data

file1.txt

A G K N Q T W
B H L O R U X
C I M P S V Y
D ...
3,418
Posted By FelipeAd
Sorry, I am not sure how to use your command in...
Sorry, I am not sure how to use your command in my case
3,418
Posted By FelipeAd
print columns of a file in a for loop
Hello,
I have a file with 32 columns and I want to print one column at a time, and then read each line of this column in order to use grep command.
I tried with awk but i cannot put variable in...
2,382
Posted By FelipeAd
Well, tha logout that created the problem was not...
Well, tha logout that created the problem was not done by me.
I login/logout vnc (when I mean screensaver i literally mean "the image on the screen where one usually sees the files" - i hope this is...
2,382
Posted By FelipeAd
When I login again I can see the screensaver but...
When I login again I can see the screensaver but not the files or anything else.
I can reach the files only through the command line
Showing results 1 to 25 of 53

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